diff options
author | Conrad Irwin <conrad.irwin@gmail.com> | 2012-05-31 00:32:41 -0700 |
---|---|---|
committer | Conrad Irwin <conrad.irwin@gmail.com> | 2012-05-31 00:32:41 -0700 |
commit | 76d09b2dc9f346e58e6ddb09e4452102bc8e952f (patch) | |
tree | 38d7d18384ab6c2e52a124a28cf12c3e2d3e2add /test/slop_test.rb | |
parent | d50a2d887f1ddc6c421cacb08a29eaf2b6948a7b (diff) | |
download | slop-76d09b2dc9f346e58e6ddb09e4452102bc8e952f.tar.gz |
Stop multiple switches from trashing arguments
Diffstat (limited to 'test/slop_test.rb')
-rw-r--r-- | test/slop_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index 0516a23..e8f03d0 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -218,6 +218,12 @@ class SlopTest < TestCase assert_equal 'abc123', opts[:f] end + test "muiltiple_switches should not trash arguments" do + opts = Slop.new{ on :f; on :b } + args = opts.parse!(%w'-fb foo') + assert_equal %w'foo', args + end + test "setting/getting the banner" do opts = Slop.new :banner => 'foo' assert_equal 'foo', opts.banner |