summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrabe, Shyouhei <shyouhei@ruby-lang.org>2017-08-21 00:41:14 +0900
committerUrabe, Shyouhei <shyouhei@ruby-lang.org>2017-08-21 00:56:34 +0900
commit94e2b6086577efcb10d22bc348d516f693b0f26f (patch)
treea0ad9c3c6c5dfa2e23782b57e7e83fbb86ef36da
parentecd1bea43731f11116925bb6805a9a135a996f11 (diff)
downloadbundler-94e2b6086577efcb10d22bc348d516f693b0f26f.tar.gz
Add specs for TOPLEVEL_BINDING pollution
-rw-r--r--spec/bundler/bundler_spec.rb18
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