summaryrefslogtreecommitdiff
path: root/spec/bundler/gem_helper_spec.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-04-13 21:23:01 -0700
committerAndre Arko <andre@arko.net>2015-04-13 22:50:16 -0700
commite41edd133a737ed95581a4e850076c7160289269 (patch)
tree896f72d91172eea039efd8052dc1362ee5a05402 /spec/bundler/gem_helper_spec.rb
parent3c3d5c635c23abd43c1e2f1b72d55f6d38956119 (diff)
downloadbundler-e41edd133a737ed95581a4e850076c7160289269.tar.gz
Merge tag 'v1.9.4'
Version 1.9.4 Conflicts: lib/bundler/installer.rb lib/bundler/match_platform.rb lib/bundler/source/rubygems.rb
Diffstat (limited to 'spec/bundler/gem_helper_spec.rb')
-rw-r--r--spec/bundler/gem_helper_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb
index 2b0f3d97aa..8cfacbac01 100644
--- a/spec/bundler/gem_helper_spec.rb
+++ b/spec/bundler/gem_helper_spec.rb
@@ -28,6 +28,15 @@ describe Bundler::GemHelper do
end
context "interpolates the name" do
+ before do
+ # Remove exception that prevents public pushes on older RubyGems versions
+ if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.0")
+ content = File.read(app_gemspec_path)
+ content.sub!(/raise "RubyGems 2\.0 or newer.*/, "")
+ File.open(app_gemspec_path, "w"){|f| f.write(content) }
+ end
+ end
+
it "when there is only one gemspec" do
expect(subject.gemspec.name).to eq(app_name)
end
@@ -62,7 +71,7 @@ describe Bundler::GemHelper do
let(:app_version) { "0.1.0" }
let(:app_gem_dir) { app_path.join("pkg") }
let(:app_gem_path) { app_gem_dir.join("#{app_name}-#{app_version}.gem") }
- let(:app_gemspec_content) { File.read(app_gemspec_path) }
+ let(:app_gemspec_content) { remove_push_guard(File.read(app_gemspec_path)) }
before(:each) do
content = app_gemspec_content.gsub("TODO: ", "")
@@ -70,6 +79,14 @@ describe Bundler::GemHelper do
File.open(app_gemspec_path, "w") { |file| file << content }
end
+ def remove_push_guard(gemspec_content)
+ # Remove exception that prevents public pushes on older RubyGems versions
+ if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.0")
+ gemspec_content.sub!(/raise "RubyGems 2\.0 or newer.*/, "")
+ end
+ gemspec_content
+ end
+
it "uses a shell UI for output" do
expect(Bundler.ui).to be_a(Bundler::UI::Shell)
end