aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_pristine_command.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:39:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-07 08:39:39 +0000
commiteb807d42eca121df22f72b95465bba52a4e7fefa (patch)
tree35b722bc6c94d3b9c5f8f80d41e889c591a80450 /test/rubygems/test_gem_commands_pristine_command.rb
parentc414d861c109ff546e2bc8c7264859907d6e0f76 (diff)
downloadruby-eb807d42eca121df22f72b95465bba52a4e7fefa.tar.gz
* gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_pristine_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb36
1 files changed, 8 insertions, 28 deletions
diff --git a/test/rubygems/test_gem_commands_pristine_command.rb b/test/rubygems/test_gem_commands_pristine_command.rb
index 4decdf81b9..9cab574a1f 100644
--- a/test/rubygems/test_gem_commands_pristine_command.rb
+++ b/test/rubygems/test_gem_commands_pristine_command.rb
@@ -15,7 +15,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute
- a = quick_spec 'a' do |s| s.executables = %w[foo] end
+ a = quick_gem 'a' do |s| s.executables = %w[foo] end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
@@ -45,7 +45,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute_all
- a = quick_spec 'a' do |s| s.executables = %w[foo] end
+ a = quick_gem 'a' do |s| s.executables = %w[foo] end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
@@ -73,29 +73,15 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute_missing_cache_gem
- a = quick_spec 'a' do |s|
- s.executables = %w[foo]
- end
-
+ a = quick_gem 'a' do |s| s.executables = %w[foo] end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
-
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
end
install_gem a
- a_data = nil
- open File.join(@gemhome, 'cache', a.file_name), 'rb' do |fp|
- a_data = fp.read
- end
-
- util_setup_fake_fetcher
- util_setup_spec_fetcher a
-
- Gem::RemoteFetcher.fetcher.data["http://gems.example.com/gems/#{a.file_name}"] = a_data
-
- FileUtils.rm Gem.cache_gem(a.file_name, @gemhome)
+ FileUtils.rm File.join(@gemhome, 'cache', a.file_name)
@cmd.options[:args] = %w[a]
@@ -105,17 +91,11 @@ class TestGemCommandsPristineCommand < Gem::TestCase
out = @ui.output.split "\n"
- [
- "Restoring gem\(s\) to pristine condition...",
- "Restored a-1",
- "Cached gem for a-2 not found, attempting to fetch...",
- "Restored a-2",
- "Restored a-3.a"
- ].each do |line|
- assert_equal line, out.shift
- end
-
+ assert_equal "Restoring gem\(s\) to pristine condition...", out.shift
assert_empty out, out.inspect
+
+ assert_equal "ERROR: Cached gem for #{a.full_name} not found, use `gem install` to restore\n",
+ @ui.error
end
def test_execute_no_gem