summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2012-04-30 10:49:34 +0100
committerLee Jarvis <lee@jarvis.co>2012-04-30 10:49:34 +0100
commit66a3f93a14f8287c01b3fd6daac8a691a8038fe9 (patch)
treefa4f93d58feaabaea553018f8096b0ba7b2138ec /test
parentcfd16f9d0c80cffe9753bb874e371879fdfed280 (diff)
parentae2627bc2b4f57fe8980ce0c289a01c6e61b2e39 (diff)
downloadslop-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.rb8
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