Odd behaviour using RSpec from Rakefile

C

Clifford Heath

I'm using RSpec with rake, with specs in the "spec" directory,
and the SpecTask is called :test.

When I run "rake test", the ARGV from rake gets picked up by
the RSpec option parser, which adds it (in option_parser.rb:123)
to the @files list. That means that later, rspec decides that
there should be a directory called "test", and an exception is
thrown from spec/runner/options.rb:216, in files_to_load.

I don't know what the expected behaviour is here, but I know that
this isn't it! It seems that RSpec shouldn't be using ARGV here,
since rake, not rspec, is the main program.

Can someone please comment on the correct way to fix this?

Clifford Heath.
 
D

David Chelimsky

I'm using RSpec with rake, with specs in the "spec" directory,
and the SpecTask is called :test.

When I run "rake test", the ARGV from rake gets picked up by
the RSpec option parser, which adds it (in option_parser.rb:123)
to the @files list. That means that later, rspec decides that
there should be a directory called "test", and an exception is
thrown from spec/runner/options.rb:216, in files_to_load.

I don't know what the expected behaviour is here, but I know that
this isn't it! It seems that RSpec shouldn't be using ARGV here,
since rake, not rspec, is the main program.

Can someone please comment on the correct way to fix this?

The best way to get things fixed in RSpec is to enter a ticket in
RSpec's tracker at http://rspec.lighthouseapp.com.

Cheers,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top