diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-04-04 19:44:52 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-04-04 19:44:52 -0500 |
commit | 4766aa7dbb7cb6ede44856a7ba74c3d9e50341f0 (patch) | |
tree | 4ed37b73509dc902622386146994a7adf4370510 | |
parent | e8144cae0e61c87050861df9735fd736dead0911 (diff) | |
download | bundler-seg-setup-activate-no-gems.tar.gz |
Avoid aliasing a missing method in specs on old RGseg-setup-activate-no-gems
-rw-r--r-- | spec/runtime/setup_spec.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 80b7d4de8d..c006e549d8 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1144,16 +1144,20 @@ end let(:code) { strip_whitespace(<<-RUBY) } require "rubygems" - Gem::Specification.send(:alias_method, :bundler_spec_activate, :activate) - Gem::Specification.send(:define_method, :activate) do - unless #{exemptions.inspect}.include?(name) - warn '-' * 80 - warn "activating \#{full_name}" - warn *caller - warn '*' * 80 + + if Gem::Specification.instance_methods.map(&:to_sym).include?(:activate) + Gem::Specification.send(:alias_method, :bundler_spec_activate, :activate) + Gem::Specification.send(:define_method, :activate) do + unless #{exemptions.inspect}.include?(name) + warn '-' * 80 + warn "activating \#{full_name}" + warn *caller + warn '*' * 80 + end + bundler_spec_activate end - bundler_spec_activate end + require "bundler/setup" require "pp" loaded_specs = Gem.loaded_specs.dup |