Skip to content

Commit 205af95

Browse files
mock availablity of webpacker and shakapacker gems
1 parent 8b931c1 commit 205af95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/react_on_rails/utils_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ module ReactOnRails
2222
end
2323

2424
shared_context "with shakapacker enabled" do
25+
before do
26+
# Mock that shakapacker is not installed, so webpacker will be used instead
27+
allow(ReactOnRails::Utils).to receive(:gem_available?).with("shakapacker").and_return(true)
28+
allow(ReactOnRails::Utils).to receive(:gem_available?).with("webpacker").and_return(false)
29+
end
30+
2531
include_context "with packer enabled"
2632

2733
# We don't need to mock anything here because the shakapacker gem is already installed and will be used by default

0 commit comments

Comments
 (0)