summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/gemfile/install_if_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb12
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb22
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb2
-rw-r--r--spec/bundler/install/gems/flex_spec.rb57
5 files changed, 54 insertions, 41 deletions
diff --git a/spec/bundler/install/gemfile/install_if_spec.rb b/spec/bundler/install/gemfile/install_if_spec.rb
index 786e0e9258..3d2d15a698 100644
--- a/spec/bundler/install/gemfile/install_if_spec.rb
+++ b/spec/bundler/install/gemfile/install_if_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe "bundle install with install_if conditionals" do
expect(the_bundle).not_to include_gems("thin")
expect(the_bundle).not_to include_gems("foo")
- lockfile_should_be <<-L
+ expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index 566fdcf65a..4143b04c2a 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -127,9 +127,9 @@ RSpec.describe "bundle install with explicit source paths" do
L
bundle :install, :dir => lib_path("demo")
- expect(lib_path("demo/Gemfile.lock")).to have_lockfile(lockfile)
+ expect(lib_path("demo/Gemfile.lock")).to read_as(lockfile)
bundle :update, :all => true, :dir => lib_path("demo")
- expect(lib_path("demo/Gemfile.lock")).to have_lockfile(lockfile)
+ expect(lib_path("demo/Gemfile.lock")).to read_as(lockfile)
end
it "expands paths when comparing locked paths to Gemfile paths" do
@@ -552,7 +552,7 @@ RSpec.describe "bundle install with explicit source paths" do
expect(the_bundle).to include_gems "rack 0.9.1"
- lockfile_should_be <<-G
+ expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
@@ -580,7 +580,7 @@ RSpec.describe "bundle install with explicit source paths" do
bundle "install"
- lockfile_should_be <<-G
+ expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
@@ -614,7 +614,7 @@ RSpec.describe "bundle install with explicit source paths" do
expect(the_bundle).to include_gems "rack 0.9.1"
- lockfile_should_be <<-G
+ expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
@@ -643,7 +643,7 @@ RSpec.describe "bundle install with explicit source paths" do
bundle "install"
- lockfile_should_be <<-G
+ expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index 7cd06b7e08..221c52c448 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -128,7 +128,7 @@ RSpec.describe "bundle install across platforms" do
gem "pry"
G
- lockfile_should_be <<-L
+ expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
@@ -156,7 +156,7 @@ RSpec.describe "bundle install across platforms" do
bundle "lock --add-platform ruby"
- good_lockfile = strip_whitespace(<<-L)
+ good_lockfile = <<~L
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
@@ -186,9 +186,9 @@ RSpec.describe "bundle install across platforms" do
#{Bundler::VERSION}
L
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
- bad_lockfile = strip_whitespace <<-L
+ bad_lockfile = <<~L
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
@@ -222,23 +222,23 @@ RSpec.describe "bundle install across platforms" do
aggregate_failures do
lockfile bad_lockfile
bundle :install
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
lockfile bad_lockfile
bundle :update, :all => true
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
lockfile bad_lockfile
bundle "update ffi"
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
lockfile bad_lockfile
bundle "update empyrean"
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
lockfile bad_lockfile
bundle :lock
- lockfile_should_be good_lockfile
+ expect(lockfile).to eq good_lockfile
end
end
@@ -310,7 +310,7 @@ RSpec.describe "bundle install across platforms" do
expect(the_bundle).to include_gem "platform_specific 1.0 RUBY"
- lockfile_should_be <<-G
+ expect(lockfile).to eq <<~G
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
@@ -447,7 +447,7 @@ RSpec.describe "bundle install with platform conditionals" do
expect(err).to be_empty
- lockfile_should_be <<-L
+ expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb
index 19ac8c6b78..ce2823ce9a 100644
--- a/spec/bundler/install/gemfile/specific_platform_spec.rb
+++ b/spec/bundler/install/gemfile/specific_platform_spec.rb
@@ -87,7 +87,7 @@ RSpec.describe "bundle install with specific platforms" do
expect(the_bundle).to include_gem("google-protobuf 3.0.0.alpha.5.0.5.1 universal-darwin")
# make sure we're still only locked to ruby
- lockfile_should_be <<-L
+ expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo2)}/
specs:
diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb
index 326ec51214..f9b374cf01 100644
--- a/spec/bundler/install/gems/flex_spec.rb
+++ b/spec/bundler/install/gems/flex_spec.rb
@@ -229,14 +229,27 @@ RSpec.describe "bundle flex_install" do
G
end
- it "does something" do
- expect do
- bundle "install", :raise_on_error => false
- end.not_to change { File.read(bundled_app_lock) }
-
- expect(err).to include("rack = 0.9.1")
- expect(err).to include("locked at 1.0.0")
- expect(err).to include("bundle update rack")
+ it "should work when you install" do
+ bundle "install"
+
+ expect(lockfile).to eq <<~L
+ GEM
+ remote: #{file_uri_for(gem_repo1)}/
+ specs:
+ rack (0.9.1)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ rack (= 0.9.1)
+ rack-obama
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
end
it "should work when you update" do
@@ -259,24 +272,24 @@ RSpec.describe "bundle flex_install" do
gem "rack"
G
- lockfile_should_be <<-L
- GEM
- remote: #{file_uri_for(gem_repo1)}/
- specs:
- rack (1.0.0)
+ expect(lockfile).to eq <<~L
+ GEM
+ remote: #{file_uri_for(gem_repo1)}/
+ specs:
+ rack (1.0.0)
- GEM
- remote: #{file_uri_for(gem_repo2)}/
- specs:
+ GEM
+ remote: #{file_uri_for(gem_repo2)}/
+ specs:
- PLATFORMS
- #{lockfile_platforms}
+ PLATFORMS
+ #{lockfile_platforms}
- DEPENDENCIES
- rack
+ DEPENDENCIES
+ rack
- BUNDLED WITH
- #{Bundler::VERSION}
+ BUNDLED WITH
+ #{Bundler::VERSION}
L
end
end