diff options
-rw-r--r-- | spec/bundler/bundler_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index abafe26f38..3e23f60f82 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -302,8 +302,14 @@ EOF end after do FileUtils.rm_rf("tmp/vendor/bundle") - Bundler.remove_instance_variable(:@requires_sudo_ran) - Bundler.remove_instance_variable(:@requires_sudo) + if Bundler.respond_to?(:remove_instance_variable) + Bundler.remove_instance_variable(:@requires_sudo_ran) + Bundler.remove_instance_variable(:@requires_sudo) + else + # TODO: Remove these code when Bundler drops Ruby 1.8.7 support + Bundler.send(:remove_instance_variable, :@requires_sudo_ran) + Bundler.send(:remove_instance_variable, :@requires_sudo) + end end context "writable paths" do it "should return false and display nothing" do |