aboutsummaryrefslogtreecommitdiffstats
path: root/spec/install/gemfile/gemspec_spec.rb
diff options
context:
space:
mode:
authorMike Virata-Stone <mjstone@on-site.com>2015-12-15 14:11:39 -0800
committerMike Virata-Stone <mjstone@on-site.com>2015-12-15 20:28:35 -0800
commit193a14fe5e0d56294c7b370a0e59f93b2c216eed (patch)
treefb755b63ee7d2528bd6e038b6043e9cc078dbf02 /spec/install/gemfile/gemspec_spec.rb
parent4cbffca5bc39eb6762048821f2314176318f35bd (diff)
downloadbundler-193a14fe5e0d56294c7b370a0e59f93b2c216eed.tar.gz
Use the local platform rather than relying on the platform reported by the spec
Add a spec which fails because of the bug created by the original platform restrictions
Diffstat (limited to 'spec/install/gemfile/gemspec_spec.rb')
-rw-r--r--spec/install/gemfile/gemspec_spec.rb81
1 files changed, 51 insertions, 30 deletions
diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb
index ef658f24..58d846e5 100644
--- a/spec/install/gemfile/gemspec_spec.rb
+++ b/spec/install/gemfile/gemspec_spec.rb
@@ -169,43 +169,64 @@ describe "bundle install from an existing gemspec" do
context "with a lockfile and some missing dependencies" do
let(:source_uri) { "http://localgemserver.test" }
- it "should install on JRuby when previously bundled for Ruby" do
- build_lib("foo", :path => tmp.join("foo")) do |s|
- s.add_dependency "rack", "=1.0.0"
- s.platform = "java"
- end
+ context "previously bundled for Ruby" do
+ let(:platform) { "ruby" }
- gemfile <<-G
- source "#{source_uri}"
- gemspec :path => "../foo"
- G
+ before do
+ build_lib("foo", :path => tmp.join("foo")) do |s|
+ s.add_dependency "rack", "=1.0.0"
+ s.platform = "java" if platform == "java"
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ gemspec :path => "../foo"
+ G
- lockfile <<-L
- PATH
- remote: ../foo
- specs:
- foo (1.0)
- rack (= 1.0.0)
+ lockfile <<-L
+ PATH
+ remote: ../foo
+ specs:
+ foo (1.0)
+ rack (= 1.0.0)
- GEM
- remote: #{source_uri}
- specs:
- rack (1.0.0)
+ GEM
+ remote: #{source_uri}
+ specs:
+ rack (1.0.0)
- PLATFORMS
- #{generic(Gem::Platform.local)}
+ PLATFORMS
+ #{generic(Gem::Platform.local)}
- DEPENDENCIES
- foo!
+ DEPENDENCIES
+ foo!
- BUNDLED WITH
- #{Bundler::VERSION}
- L
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+
+ context "using JRuby" do
+ let(:platform) { "java" }
+
+ it "should install" do
+ simulate_ruby_engine "jruby" do
+ simulate_platform "java" do
+ results = bundle "install", :artifice => "endpoint"
+ expect(results).to include("Installing rack 1.0.0")
+ should_be_installed "rack 1.0.0"
+ end
+ end
+ end
+ end
- simulate_ruby_engine "jruby" do
- simulate_platform "java" do
- bundle "install", :artifice => "endpoint"
- should_be_installed "rack 1.0.0"
+ context "using Windows" do
+ it "should install" do
+ simulate_windows do
+ results = bundle "install", :artifice => "endpoint"
+ expect(results).to include("Installing rack 1.0.0")
+ should_be_installed "rack 1.0.0"
+ end
end
end
end