[rspec-users] Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1
dchelimsky at gmail.com
Fri Nov 5 07:59:12 EDT 2010
On Nov 4, 2010, at 3:37 PM, Jarmo Pertman wrote:
> There seems to be also a problem when using RCov raketask - it doesn't
> seem to load RSpec.
> Consider the following project structure:
> # Rakefile
> require 'rspec/core/rake_task'
> RSpec::Core::RakeTask.new(:spec) do |spec|
> RSpec::Core::RakeTask.new(:rcov) do |spec|
> spec.rcov = true
> # lib/my_lib.rb
> class MyLib
> # spec/my_lib_spec.rb
> require "lib/my_lib"
> describe "should work" do
> it "doesn't" do
> MyLib.new.should be
> Now, when executing `rake spec` everything works - RSpec itself gets
> loaded automatically. When executing `rake rcov` on the other hand
> then this will be the output:
> C:\Users\jarmo\Desktop\minu\projects\Ruby\blah>rake rcov
> (in C:/Users/jarmo/Desktop/minu/projects/Ruby/blah)
> c:/ruby/bin/ruby.exe -S rcov -Ispec "./spec/my_lib_spec.rb"
> ./spec/my_lib_spec.rb:1: undefined method `describe' for main:Object
> from c:/ruby/lib/ruby/gems/1.8/gems/rcov-0.9.8/bin/rcov:511:in
> from c:/ruby/lib/ruby/gems/1.8/gems/rcov-0.9.8/bin/rcov:511
> from c:/ruby/bin/rcov:19:in `load'
> from c:/ruby/bin/rcov:19
> rake aborted!
> ruby -S rcov -Ispec "./spec/my_lib_spec.rb" failed
> It will pass of course if i'll add `require "rspec"` to somewhere.
Bug. Please report this to http://github.com/rspec/rspec-core/issues.
More information about the rspec-users