diff options
author | Lee Jarvis <lee@jarvis.co> | 2012-04-30 10:49:34 +0100 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2012-04-30 10:49:34 +0100 |
commit | 66a3f93a14f8287c01b3fd6daac8a691a8038fe9 (patch) | |
tree | fa4f93d58feaabaea553018f8096b0ba7b2138ec /test | |
parent | cfd16f9d0c80cffe9753bb874e371879fdfed280 (diff) | |
parent | ae2627bc2b4f57fe8980ce0c289a01c6e61b2e39 (diff) | |
download | slop-66a3f93a14f8287c01b3fd6daac8a691a8038fe9.tar.gz |
Merge branch 'to_hash_take2' of https://github.com/no6v/slop into no6v-to_hash_take2
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index 023128e..7572e7b 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -157,9 +157,9 @@ class SlopTest < TestCase end test "to_hash()" do - opts = Slop.new { on :foo=; on :bar } - opts.parse(%w'--foo hello --bar') - assert_equal({ :foo => 'hello', :bar => nil }, opts.to_hash) + opts = Slop.new { on :foo=; on :bar; on :baz } + opts.parse(%w'--foo hello --no-bar') + assert_equal({ :foo => 'hello', :bar => false, :baz => nil }, opts.to_hash) end test "missing() returning all missing option keys" do @@ -235,7 +235,7 @@ class SlopTest < TestCase opts = Slop.new { on :foo=; on :bar; on :baz } opts.parse %w' --foo hello --bar ' assert_equal 'hello', opts[:foo] - assert_nil opts[:bar] + assert_equal true, opts[:bar] assert_nil opts[:baz] end |