1require 'rubygems/test_case'
2require 'rubygems/commands/mirror_command'
3
4class TestGemCommandsMirrorCommand < Gem::TestCase
5
6  def setup
7    super
8
9    @cmd = Gem::Commands::MirrorCommand.new
10
11    @mirror_specs = Gem::Specification.find_all_by_name('rubygems-mirror').each do |spec|
12      Gem::Specification.remove_spec spec
13    end
14  end
15
16  def teardown
17    @mirror_specs.each do |spec|
18      Gem::Specification.add_spec spec
19    end
20
21    super
22  end
23
24  def test_execute
25    use_ui @ui do
26      @cmd.execute
27    end
28
29    assert_match %r%Install the rubygems-mirror%i, @ui.error
30  end
31
32end
33