    end
  
    def test_self_prefix_libdir
-@@ -1551,7 +1555,13 @@ def test_auto_activation_of_used_gemdeps_file
+@@ -1543,7 +1547,13 @@ def test_auto_activation_of_used_gemdeps_file
      assert_equal expected_specs, Gem.use_gemdeps.sort_by { |s| s.name }
    end
  

Patch by MSP-Greg
Allows running Core RubyGems tests from installed Ruby
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index e062eebbaa..92218bc8df 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -882,7 +882,11 @@ def test_self_platforms
   end
 
   def test_self_prefix

+  else  
+    LIB_PATH = File.expand_path("../../../lib".dup.untaint, __FILE__.dup.untaint)
+  end
   BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }.dup.untaint
   BUNDLER_FULL_NAME = "bundler-#{Bundler::VERSION}".freeze
 
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb
index d9ee5f8468..105c7b2c4c 100644
--- a/test/rubygems/test_gem_commands_update_command.rb
+++ b/test/rubygems/test_gem_commands_update_command.rb
@@ -502,8 +502,11 @@ def test_update_rubygems_arguments
 
     arguments = @cmd.update_rubygems_arguments
 
-    assert_equal '--prefix',           arguments.shift
-    assert_equal Gem.prefix,           arguments.shift
+    # asserts fail from install folder
+    if Gem.method(:host).source_location[0].start_with? "#{@@project_dir}/"
+      assert_equal '--prefix',           arguments.shift
+      assert_equal Gem.prefix,           arguments.shift
+    end
     assert_equal '--no-document',      arguments.shift
     assert_equal '--previous-version', arguments.shift
     assert_equal Gem::VERSION,         arguments.shift
