Sha256: 06d888879ea238b99c2df626eb01895f5bac668495c475e5647cabdbe4609954

Contents?: true

Size: 501 Bytes

Versions: 11

Compression:

Stored size: 501 Bytes

Contents

require 'test_helper'

module Optimist
  class CommandlineErrorTest < ::MiniTest::Test
    def test_class
      assert_kind_of Exception, cle("message")
    end

    def test_message
      assert "message", cle("message").message
    end

    def test_error_code_default
      assert_nil cle("message").error_code
    end

    def test_error_code_custom
      assert_equal(-3, cle("message", -3).error_code)
    end

    private

    def cle(*args)
      CommandlineError.new(*args)
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
optimist-3.1.0 test/optimist/command_line_error_test.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.1/test/optimist/command_line_error_test.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.1/test/optimist/command_line_error_test.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.1/test/optimist/command_line_error_test.rb
optimist-3.0.1 test/optimist/command_line_error_test.rb
pokedex-terminal-0.2.8 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.0/test/optimist/command_line_error_test.rb
pokedex-terminal-0.2.7 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.0/test/optimist/command_line_error_test.rb
pokedex-terminal-0.2.6 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.0/test/optimist/command_line_error_test.rb
pokedex-terminal-0.2.5 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.0/test/optimist/command_line_error_test.rb
pokedex-terminal-0.2.4 vendor/bundle/ruby/2.7.0/gems/optimist-3.0.0/test/optimist/command_line_error_test.rb
optimist-3.0.0 test/optimist/command_line_error_test.rb