From 20fc9c746b627e6d189dea552b4a0893059c8ccb Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Mon, 12 Mar 2018 17:49:35 +0900 Subject: Add backward compatibility code for Ruby 1.8.7 --- spec/bundler/bundler_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'spec/bundler/bundler_spec.rb') 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 -- cgit v1.2.1