~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/rubygems/test_gem_commands_outdated_command.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
require_relative 'gemutilities'
 
1
require 'rubygems/test_case'
2
2
require 'rubygems/commands/outdated_command'
3
3
 
4
 
class TestGemCommandsOutdatedCommand < RubyGemTestCase
 
4
class TestGemCommandsOutdatedCommand < Gem::TestCase
5
5
 
6
6
  def setup
7
7
    super
14
14
  end
15
15
 
16
16
  def test_execute
17
 
    local_01 = quick_gem 'foo', '0.1'
18
 
    local_02 = quick_gem 'foo', '0.2'
19
 
    remote_10 = quick_gem 'foo', '1.0'
20
 
    remote_20 = quick_gem 'foo', '2.0'
21
 
 
22
 
    remote_spec_file = File.join @gemhome, 'specifications', remote_10.spec_name
23
 
    FileUtils.rm remote_spec_file
24
 
 
25
 
    remote_spec_file = File.join @gemhome, 'specifications', remote_20.spec_name
26
 
    FileUtils.rm remote_spec_file
27
 
 
28
 
    @fetcher = Gem::FakeFetcher.new
29
 
    Gem::RemoteFetcher.fetcher = @fetcher
30
 
 
 
17
    remote_10 = quick_spec 'foo', '1.0'
 
18
    remote_20 = quick_spec 'foo', '2.0'
 
19
 
 
20
    Gem::RemoteFetcher.fetcher = @fetcher = Gem::FakeFetcher.new
 
21
 
 
22
    util_clear_gems
31
23
    util_setup_spec_fetcher remote_10, remote_20
32
24
 
33
 
    use_ui @ui do @cmd.execute end
 
25
    quick_gem 'foo', '0.1'
 
26
    quick_gem 'foo', '0.2'
 
27
 
 
28
    Gem::Specification.reset
 
29
 
 
30
    use_ui @ui do
 
31
      @cmd.execute
 
32
    end
34
33
 
35
34
    assert_equal "foo (0.2 < 2.0)\n", @ui.output
36
35
    assert_equal "", @ui.error
37
36
  end
38
 
 
39
37
end
40
38