Skip to content

Commit

Permalink
mock availablity of webpacker and shakapacker gems
Browse files Browse the repository at this point in the history
  • Loading branch information
AbanoubGhadban committed Dec 18, 2024
1 parent 8b931c1 commit 205af95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/react_on_rails/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ module ReactOnRails
end

shared_context "with shakapacker enabled" do
before do
# Mock that shakapacker is not installed, so webpacker will be used instead
allow(ReactOnRails::Utils).to receive(:gem_available?).with("shakapacker").and_return(true)
allow(ReactOnRails::Utils).to receive(:gem_available?).with("webpacker").and_return(false)
end

include_context "with packer enabled"

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

0 comments on commit 205af95

Please sign in to comment.