Sha256: 2e3ef8bc9d7d77ec3b10f28eef75342c14abf9682894276605b48e4e8774109f

Contents?: true

Size: 783 Bytes

Versions: 6

Compression:

Stored size: 783 Bytes

Contents

require 'rubygems/test_case'
require 'rubygems/commands/compare_command'

class TestGemCommandsCompareCommand < Gem::TestCase
  def setup
    super

    @command = Gem::Commands::CompareCommand.new
  end

  def test_execute_no_gemfile
    @command.options[:args] = []

    e = assert_raises Gem::CommandLineError do
      use_ui @ui do
        @command.execute
      end
    end

    assert_match 'Please specify a gem (e.g. gem compare foo VERSION [VERSION ...])', e.message
  end

  def test_execute_no_patch
    @command.options[:args] = ['my_gem']

    e = assert_raises Gem::CommandLineError do
      use_ui @ui do
        @command.execute
      end
    end

    assert_match 'Please specify versions you want to compare (e.g. gem compare foo 0.1.0 0.2.0)', e.message
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gem-compare-0.0.7 test/rubygems/test_gem_commands_compare_command.rb
gem-compare-0.0.6 test/rubygems/test_gem_commands_compare_command.rb
gem-compare-0.0.5 test/rubygems/test_gem_commands_compare_command.rb
gem-compare-0.0.4 test/rubygems/test_gem_commands_compare_command.rb
gem-compare-0.0.3 test/rubygems/test_gem_commands_compare_command.rb
gem-compare-0.0.2 test/rubygems/test_gem_commands_compare_command.rb