Skip to content

Commit 06ea88e

Browse files
committed
test: Correct deployment spec for modern bundler
1 parent b7d356c commit 06ea88e

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

spec/sample_bundler/.bundle/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
BUNDLE_FROZEN: "true"
33
BUNDLE_PATH: "vendor/bundle"
44
BUNDLE_DISABLE_SHARED_GEMS: "1"
5+
BUNDLE_DEPLOYMENT: "false"

spec/warbler/bundler_spec.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ def use_config(&block)
2222
@extra_config = block
2323
end
2424

25+
def bundle(*args)
26+
`cd #{Dir.pwd} && #{RUBY_EXE} -S bundle _#{::Bundler::VERSION}_ #{args.join(' ')}`
27+
end
28+
2529
def bundle_install(*args)
26-
`cd #{Dir.pwd} && #{RUBY_EXE} -S bundle install #{args.join(' ')}`
30+
bundle('install', *args)
2731
end
2832

2933
let(:config) { drbclient.config(@extra_config) }
@@ -233,13 +237,21 @@ def bundle_install(*args)
233237
context "when deployment" do
234238
run_in_directory "spec/sample_bundler"
235239

240+
before do
241+
bundle 'config', 'deployment', 'true'
242+
end
243+
236244
it "includes the bundler gem" do
237-
bundle_install '--deployment'
245+
bundle_install
238246
jar.apply(config)
239247
expect(file_list(%r{gems/rake-13.3.0/lib})).to_not be_empty
240248
expect(file_list(%r{gems/bundler-})).to_not be_empty
241249
expect(file_list(%r{gems/bundler-.*/exe})).to_not be_empty
242250
end
251+
252+
after do
253+
bundle 'config', 'deployment', 'false'
254+
end
243255
end
244256

245257
context "in a rack app" do

0 commit comments

Comments
 (0)