aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-09 20:26:44 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-07-24 14:59:32 +0900
commitebc3174123c62bb20fb34a8a778a659aa4f1146d (patch)
tree5b0aae3fa317e999071bd3fe99ed4be2a52049a1 /spec
parentbcc160b449f63bc7608feaa125259bdedbe6e115 (diff)
downloadruby-ebc3174123c62bb20fb34a8a778a659aa4f1146d.tar.gz
[rubygems/rubygems] Simplify `bundle lock` specs
https://github.com/rubygems/rubygems/commit/6301d3eece
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/lock_spec.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 491fa30949..cbf5394588 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -1,12 +1,8 @@
# frozen_string_literal: true
RSpec.describe "bundle lock" do
- def strip_lockfile(lockfile)
- strip_whitespace(lockfile).sub(/\n\Z/, "")
- end
-
def read_lockfile(file = "Gemfile.lock")
- strip_lockfile bundled_app(file).read
+ bundled_app(file).read
end
let(:repo) { gem_repo1 }
@@ -19,7 +15,7 @@ RSpec.describe "bundle lock" do
gem "foo"
G
- @lockfile = strip_lockfile(<<-L)
+ @lockfile = <<~L
GEM
remote: #{file_uri_for(repo)}/
specs:
@@ -58,7 +54,7 @@ RSpec.describe "bundle lock" do
it "prints a lockfile when there is no existing lockfile with --print" do
bundle "lock --print"
- expect(out).to eq(@lockfile)
+ expect(out).to eq(@lockfile.strip)
end
it "prints a lockfile when there is an existing lockfile with --print" do
@@ -66,7 +62,7 @@ RSpec.describe "bundle lock" do
bundle "lock --print"
- expect(out).to eq(@lockfile)
+ expect(out).to eq(@lockfile.strip)
end
it "writes a lockfile when there is no existing lockfile" do
@@ -94,7 +90,7 @@ RSpec.describe "bundle lock" do
source "#{file_uri_for(repo)}"
gem "foo"
G
- lockfile = strip_lockfile(<<-L)
+ lockfile = <<~L
GEM
remote: #{file_uri_for(repo)}/
specs: