Sha256: 0d0604f8ae297639dc1ed557b2bb584b635ed6e4ffb20a716546bffa178a54e6

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

require 'executable'

class TestExecutable < Test::Unit::TestCase

  class SampleCli
    include Executable

    attr :result

    def initialize
      @result = []
    end

    def output=(value)
      @result << "output: #{value}"
    end

    def jump
      @result << "jump"
    end
  end

  #
  def test_parse_without_option
    s = SampleCli.new
    s.execute_command("jump")
    assert_equal(s.result, ["jump"])
  end

  #
  def test_parse_with_option
    s = SampleCli.new
    s.execute_command("jump --output=home")
    assert_equal(s.result, ['output: home', 'jump'])
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
executable-1.0.0 test/test_executable.rb