Change soft-fail to use the config, rather than env
[rbx.git] / test / rubygems / test_gem_commands_outdated_command.rb
bloba6668c01fc267d439afd3e2556ddcd3e8a566543
1 require 'test/unit'
2 require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
3 require 'rubygems/commands/outdated_command'
5 class TestGemCommandsOutdatedCommand < RubyGemTestCase
7   def setup
8     super
10     @cmd = Gem::Commands::OutdatedCommand.new
11   end
13   def test_initialize
14     assert @cmd.handles?(%W[--platform #{Gem::Platform.local}])
15   end
17   def test_execute
18     local_01 = quick_gem 'foo', '0.1'
19     local_02 = quick_gem 'foo', '0.2'
20     remote_10 = quick_gem 'foo', '1.0'
21     remote_20 = quick_gem 'foo', '2.0'
23     remote_spec_file = File.join @gemhome, 'specifications',
24                                  remote_10.full_name + ".gemspec"
25     FileUtils.rm remote_spec_file
27     remote_spec_file = File.join @gemhome, 'specifications',
28                                  remote_20.full_name + ".gemspec"
29     FileUtils.rm remote_spec_file
31     @fetcher = Gem::FakeFetcher.new
32     Gem::RemoteFetcher.fetcher = @fetcher
34     util_setup_spec_fetcher remote_10, remote_20
36     use_ui @ui do @cmd.execute end
38     assert_equal "foo (0.2 < 2.0)\n", @ui.output
39     assert_equal "", @ui.error
40   end
42 end