[rspec-users] Such a simple test fails. But why ?
katrina.owen at gmail.com
Wed Feb 15 14:59:30 EST 2012
On Wed, Feb 15, 2012 at 5:57 PM, Serguei Cambour <lists at ruby-forum.com> wrote:
> WHY the second argument is NIL if it WAS NOT before
If you change this:
> options.export_folder.should == argv
You will see that you get the value that you've set in DEFAULT_EXPORT_FOLDER.
That's not quite the desired behavior either, though.
I think the issue is with the OptionParser... you define all the
options, but I can't see that you ever actually tell it to parse.
> option_parser = OptionParser.new do |opts|
> # lots of definitions
If I'm reading this correctly, the missing piece of code is this:
Note that you don't want to use the bang version, because that will
change your argv array, and when you compare it in the spec, argv
will be nil.
More information about the rspec-users