summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem.rb')
-rw-r--r--test/rubygems/test_gem.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 57e1f4f16f..aef00cd761 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -21,7 +21,7 @@ class TestGem < Gem::TestCase
common_installer_setup
ENV.delete 'RUBYGEMS_GEMDEPS'
- @additional = %w[a b].map { |d| File.join @tempdir, d }
+ @additional = %w[a b].map {|d| File.join @tempdir, d }
util_remove_interrupt_command
end
@@ -105,7 +105,7 @@ class TestGem < Gem::TestCase
installed = Gem.install 'a', '= 1', :install_dir => gemhome2
- assert_equal %w[a-1], installed.map { |spec| spec.full_name }
+ assert_equal %w[a-1], installed.map {|spec| spec.full_name }
assert_path_exists File.join(gemhome2, 'gems', 'a-1')
end
@@ -124,7 +124,7 @@ class TestGem < Gem::TestCase
rescue StandardError
Gem.install 'a', '= 1', :install_dir => gemhome2
end
- assert_equal %w[a-1], installed.map { |spec| spec.full_name }
+ assert_equal %w[a-1], installed.map {|spec| spec.full_name }
end
def test_self_install_permissions
@@ -208,7 +208,7 @@ class TestGem < Gem::TestCase
end
assert_equal(expected, result)
ensure
- File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.tap(&Gem::UNTAINT)})
+ File.chmod(0755, *Dir.glob(@gemhome + '/gems/**/').map {|path| path.tap(&Gem::UNTAINT) })
end
def test_require_missing
@@ -337,7 +337,7 @@ class TestGem < Gem::TestCase
L
end
- File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') }
+ File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
e = assert_raises Gem::GemNotFoundException do
load Gem.activate_bin_path("bundler", "bundle", ">= 0.a")
@@ -376,7 +376,7 @@ class TestGem < Gem::TestCase
L
end
- File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') }
+ File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
load Gem.activate_bin_path("bundler", "bundle", ">= 0.a")
@@ -410,7 +410,7 @@ class TestGem < Gem::TestCase
L
end
- File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') }
+ File.open("Gemfile", "w") {|f| f.puts('source "https://rubygems.org"') }
load Gem.activate_bin_path("bundler", "bundle", "= 1.17.3")
@@ -1021,7 +1021,7 @@ class TestGem < Gem::TestCase
Gem.refresh
- Gem::Specification.each{|spec| assert spec.activated? if spec == s}
+ Gem::Specification.each{|spec| assert spec.activated? if spec == s }
Gem.loaded_specs.delete(s)
Gem.refresh
@@ -1163,7 +1163,7 @@ class TestGem < Gem::TestCase
def test_self_post_build
assert_equal 1, Gem.post_build_hooks.length
- Gem.post_build { |installer| }
+ Gem.post_build {|installer| }
assert_equal 2, Gem.post_build_hooks.length
end
@@ -1171,7 +1171,7 @@ class TestGem < Gem::TestCase
def test_self_post_install
assert_equal 1, Gem.post_install_hooks.length
- Gem.post_install { |installer| }
+ Gem.post_install {|installer| }
assert_equal 2, Gem.post_install_hooks.length
end
@@ -1179,7 +1179,7 @@ class TestGem < Gem::TestCase
def test_self_done_installing
assert_empty Gem.done_installing_hooks
- Gem.done_installing { |gems| }
+ Gem.done_installing {|gems| }
assert_equal 1, Gem.done_installing_hooks.length
end
@@ -1187,7 +1187,7 @@ class TestGem < Gem::TestCase
def test_self_post_reset
assert_empty Gem.post_reset_hooks
- Gem.post_reset { }
+ Gem.post_reset {}
assert_equal 1, Gem.post_reset_hooks.length
end
@@ -1195,7 +1195,7 @@ class TestGem < Gem::TestCase
def test_self_post_uninstall
assert_equal 1, Gem.post_uninstall_hooks.length
- Gem.post_uninstall { |installer| }
+ Gem.post_uninstall {|installer| }
assert_equal 2, Gem.post_uninstall_hooks.length
end
@@ -1203,7 +1203,7 @@ class TestGem < Gem::TestCase
def test_self_pre_install
assert_equal 1, Gem.pre_install_hooks.length
- Gem.pre_install { |installer| }
+ Gem.pre_install {|installer| }
assert_equal 2, Gem.pre_install_hooks.length
end
@@ -1211,7 +1211,7 @@ class TestGem < Gem::TestCase
def test_self_pre_reset
assert_empty Gem.pre_reset_hooks
- Gem.pre_reset { }
+ Gem.pre_reset {}
assert_equal 1, Gem.pre_reset_hooks.length
end
@@ -1219,7 +1219,7 @@ class TestGem < Gem::TestCase
def test_self_pre_uninstall
assert_equal 1, Gem.pre_uninstall_hooks.length
- Gem.pre_uninstall { |installer| }
+ Gem.pre_uninstall {|installer| }
assert_equal 2, Gem.pre_uninstall_hooks.length
end
@@ -1248,7 +1248,7 @@ class TestGem < Gem::TestCase
install_specs b1, b2, b3
- specs1 = Gem::Specification.stubs.find_all { |s| s.name == 'b' }
+ specs1 = Gem::Specification.stubs.find_all {|s| s.name == 'b' }
Gem::Specification.reset
specs2 = Gem::Specification.stubs_for('b')
assert_equal specs1.map(&:version), specs2.map(&:version)
@@ -1397,7 +1397,7 @@ class TestGem < Gem::TestCase
r.gem "b", "= 1"
end
- activated = Gem::Specification.map { |x| x.full_name }
+ activated = Gem::Specification.map {|x| x.full_name }
assert_equal %w[a-1 b-1 c-2], activated.sort
end
@@ -1518,8 +1518,8 @@ class TestGem < Gem::TestCase
def test_gem_path_ordering
refute_equal Gem.dir, Gem.user_dir
- write_file File.join(@tempdir, 'lib', "g.rb") { |fp| fp.puts "" }
- write_file File.join(@tempdir, 'lib', 'm.rb') { |fp| fp.puts "" }
+ write_file File.join(@tempdir, 'lib', "g.rb") {|fp| fp.puts "" }
+ write_file File.join(@tempdir, 'lib', 'm.rb') {|fp| fp.puts "" }
g = util_spec 'g', '1', nil, "lib/g.rb"
m = util_spec 'm', '1', nil, "lib/m.rb"
@@ -1574,8 +1574,8 @@ class TestGem < Gem::TestCase
end
def test_gem_path_ordering_short
- write_file File.join(@tempdir, 'lib', "g.rb") { |fp| fp.puts "" }
- write_file File.join(@tempdir, 'lib', 'm.rb') { |fp| fp.puts "" }
+ write_file File.join(@tempdir, 'lib', "g.rb") {|fp| fp.puts "" }
+ write_file File.join(@tempdir, 'lib', 'm.rb') {|fp| fp.puts "" }
g = util_spec 'g', '1', nil, "lib/g.rb"
m = util_spec 'm', '1', nil, "lib/m.rb"
@@ -1632,7 +1632,7 @@ class TestGem < Gem::TestCase
ENV['RUBYGEMS_GEMDEPS'] = "-"
expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact
- assert_equal expected_specs, Gem.use_gemdeps.sort_by { |s| s.name }
+ assert_equal expected_specs, Gem.use_gemdeps.sort_by {|s| s.name }
end
BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }
@@ -1765,7 +1765,7 @@ class TestGem < Gem::TestCase
spec = util_spec 'a', 1
install_specs spec
- spec = Gem::Specification.find { |s| s == spec }
+ spec = Gem::Specification.find {|s| s == spec }
refute spec.activated?
File.open gem_deps_file, 'w' do |io|
@@ -1826,7 +1826,7 @@ class TestGem < Gem::TestCase
spec = util_spec 'a', 1
install_specs spec
- spec = Gem::Specification.find { |s| s == spec }
+ spec = Gem::Specification.find {|s| s == spec }
refute spec.activated?
@@ -1904,7 +1904,7 @@ You may need to `gem install -g` to install missing gems
spec = util_spec 'a', 1
install_specs spec
- spec = Gem::Specification.find { |s| s == spec }
+ spec = Gem::Specification.find {|s| s == spec }
refute spec.activated?
File.open 'x', 'w' do |io|