Sha256: 921f666c534353f88db1edcf8abdc837dc1cdebae19ba859a43f0e900db92904

Contents?: true

Size: 492 Bytes

Versions: 117

Compression:

Stored size: 492 Bytes

Contents

require 'helper'

class CommandsTest < TestCase

  def setup
    @opts = Slop.new do |o|
      o.on :v, :version
      o.command :add do |add|
        add.on :v, 'verbose mode'
      end
    end
  end

  test "parse! removes the command AND its options" do
    items = %w'add -v'
    @opts.parse! items
    assert_equal [], items
  end

  test "parse does not remove the command or its options" do
    items = %w'add -v'
    @opts.parse items
    assert_equal ['add', '-v'], items
  end

end

Version data entries

117 entries across 110 versions & 35 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/slop-3.6.0/test/commands_test.rb