diff options
author | Lee Jarvis <lee@jarvis.co> | 2012-01-12 15:31:06 +0000 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2012-01-12 15:31:06 +0000 |
commit | 19dcf56a20fb8a5ec4e7a6afaa3edb65a54f0225 (patch) | |
tree | 2c61ab3776f3b87ee4d745dd4fd859de2c986aff /test | |
parent | 6b546eee11f85e7aa996e3f0e2cc85566241c5c0 (diff) | |
download | slop-19dcf56a20fb8a5ec4e7a6afaa3edb65a54f0225.tar.gz |
added tests for multiple switches
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index e03d93d..56045b6 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -169,6 +169,13 @@ class SlopTest < TestCase assert_raises(Slop::InvalidOptionError) { opts.parse %w'-fabc' } end + test "multiple_switches is enabled by default" do + opts = Slop.new { on :f; on :b } + opts.parse %w[ -fb ] + assert opts.present?(:f) + assert opts.present?(:b) + end + test "setting/getting the banner" do opts = Slop.new :banner => 'foo' assert_equal 'foo', opts.banner |