diff options
author | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2017-08-21 00:41:14 +0900 |
---|---|---|
committer | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2017-08-21 00:56:34 +0900 |
commit | 94e2b6086577efcb10d22bc348d516f693b0f26f (patch) | |
tree | a0ad9c3c6c5dfa2e23782b57e7e83fbb86ef36da | |
parent | ecd1bea43731f11116925bb6805a9a135a996f11 (diff) | |
download | bundler-94e2b6086577efcb10d22bc348d516f693b0f26f.tar.gz |
Add specs for TOPLEVEL_BINDING pollution
-rw-r--r-- | spec/bundler/bundler_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 633aed12db..ee117adc6e 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -102,6 +102,24 @@ RSpec.describe Bundler do subject end end + + context "with gemspec containing local variables" do + before do + File.open(app_gemspec_path, "wb") do |f| + f.write strip_whitespace(<<-GEMSPEC) + must_not_leak = true + Gem::Specification.new do |gem| + gem.name = "leak check" + end + GEMSPEC + end + end + + it "should not pollute the TOPLEVEL_BINDING" do + subject + expect(TOPLEVEL_BINDING.local_variables).to_not include(:must_not_leak) + end + end end describe "#which" do |