test/test_gem_installer.rb in rubygems-update-1.3.1 vs test/test_gem_installer.rb in rubygems-update-1.3.2

- old
+ new

@@ -29,11 +29,11 @@ version = $1 ARGV.shift end gem 'a', version -load 'my_exec' +load Gem.bin_path('a', 'my_exec', version) EOF wrapper = @installer.app_script_text 'my_exec' assert_equal expected, wrapper end @@ -44,11 +44,11 @@ end assert_equal '', @ui.output assert_equal '', @ui.error - assert !File.exist?('gem_make.out') + refute File.exist?('gem_make.out') end def test_build_extensions_extconf_bad @spec.extensions << 'extconf.rb' @@ -286,16 +286,20 @@ def test_generate_bin_script_no_perms @installer.wrappers = true util_make_exec Dir.mkdir util_inst_bindir - File.chmod 0000, util_inst_bindir - assert_raises Gem::FilePermissionError do - @installer.generate_bin - end + if win_platform? + skip('test_generate_bin_script_no_perms skipped on MS Windows') + else + File.chmod 0000, util_inst_bindir + assert_raises Gem::FilePermissionError do + @installer.generate_bin + end + end ensure File.chmod 0700, util_inst_bindir unless $DEBUG end def test_generate_bin_script_no_shebang @@ -371,16 +375,20 @@ @installer.wrappers = false util_make_exec @installer.gem_dir = util_gem_dir Dir.mkdir util_inst_bindir - File.chmod 0000, util_inst_bindir - assert_raises Gem::FilePermissionError do - @installer.generate_bin - end + if win_platform? + skip('test_generate_bin_symlink_no_perms skipped on MS Windows') + else + File.chmod 0000, util_inst_bindir + assert_raises Gem::FilePermissionError do + @installer.generate_bin + end + end ensure File.chmod 0700, util_inst_bindir unless $DEBUG end def test_generate_bin_symlink_update_newer @@ -533,11 +541,11 @@ util_setup_gem cache_file = File.join @gemhome, 'cache', "#{@spec.full_name}.gem" Gem.pre_install do |installer| - assert !File.exist?(cache_file), 'cache file should not exist yet' + refute File.exist?(cache_file), 'cache file should not exist yet' end Gem.post_install do |installer| assert File.exist?(cache_file), 'cache file should exist' end @@ -769,11 +777,11 @@ def test_installation_satisfies_dependency_eh dep = Gem::Dependency.new 'a', '>= 2' assert @installer.installation_satisfies_dependency?(dep) dep = Gem::Dependency.new 'a', '> 2' - assert ! @installer.installation_satisfies_dependency?(dep) + refute @installer.installation_satisfies_dependency?(dep) end def test_shebang util_make_exec '2', "#!/usr/bin/ruby" @@ -816,11 +824,11 @@ def test_shebang_env_shebang util_make_exec '2', '' @installer.env_shebang = true shebang = @installer.shebang 'my_exec' - assert_equal "#!/usr/bin/env #{Gem::ConfigMap[:RUBY_INSTALL_NAME]}", shebang + assert_equal "#!/usr/bin/env #{Gem::ConfigMap[:ruby_install_name]}", shebang end def test_shebang_nested util_make_exec '2', "#!/opt/local/ruby/bin/ruby" @@ -882,10 +890,10 @@ def test_write_spec spec_dir = File.join @gemhome, 'specifications' spec_file = File.join spec_dir, "#{@spec.full_name}.gemspec" FileUtils.rm spec_file - assert !File.exist?(spec_file) + refute File.exist?(spec_file) @installer.spec = @spec @installer.gem_home = @gemhome @installer.write_spec