On Wed, Feb 15, 2012 at 5:57 PM, Serguei Cambour <li...@ruby-forum.com> wrote:

> WHY the second argument is NIL if it WAS NOT before
> (path/to/some/folder)?

If you change this:
> options.export_folder.should == argv[1]

to this:
options.export_folder.should eq(argv[1])

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
> end

If I'm reading this correctly, the missing piece of code is this:
option_parser.parse(argv)

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[1]
will be nil.

Cheers,
Katrina
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to