Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 6686d0f

Browse files
committed
Fix asset_pipeline_spec
Looks like rake or rspec will clean the previous BUNDLE_GEMFILE env. Workaround is to store the original one and set directly while shelling out.
1 parent a194644 commit 6686d0f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Rakefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ require 'bundler'
22
Bundler.require
33
Bundler::GemHelper.install_tasks
44

5+
# Store the BUNDLE_GEMFILE env, since rake or rspec seems to clean it
6+
# while invoking task.
7+
ENV['REAL_BUNDLE_GEMFILE'] = ENV['BUNDLE_GEMFILE']
58

69
require 'rspec/core/rake_task'
710
require 'opal/rspec/rake_task'

spec/reactive-ruby/rails/asset_pipeline_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
if ruby?
44
RSpec.describe 'test_app generator' do
55
it "does not interfer with asset precompilation" do
6-
env = { "BUNDLE_GEMFILE" => ENV['BUNDLE_GEMFILE'] }
7-
expect(system(env, "cd spec/test_app; bundle exec rake assets:precompile")).to be_truthy
6+
cmd = "cd spec/test_app; BUNDLE_GEMFILE=#{ENV['REAL_BUNDLE_GEMFILE']} bundle exec rake assets:precompile"
7+
expect(system(cmd)).to be_truthy
88
end
99
end
1010
end

0 commit comments

Comments
 (0)