summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2013-01-13 11:50:04 +0000
committerLee Jarvis <ljjarvis@gmail.com>2013-01-13 11:50:04 +0000
commit0e7a60e5e85349abba6eb006183f922263b90f61 (patch)
treed3ac37252e69acca93114d3d4ecb07732a65f199 /test
parent8461721da352bcc3ad386ddbf1d9d2466fb530bc (diff)
downloadslop-0e7a60e5e85349abba6eb006183f922263b90f61.tar.gz
ensure any new options replace old ones so no duplicates exist
closes #100
Diffstat (limited to 'test')
-rw-r--r--test/slop_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb
index 806f5ea..81d9a2a 100644
--- a/test/slop_test.rb
+++ b/test/slop_test.rb
@@ -448,4 +448,13 @@ class SlopTest < TestCase
end
end
+ test "duplicate options should not exist, new options should replace old ones" do
+ i = nil
+ Slop.parse(%w'-v') do
+ on(:v) { i = 'first' }
+ on(:v) { i = 'second' }
+ end
+ assert_equal 'second', i
+ end
+
end