Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test correction
  • Loading branch information
bopm committed Jun 2, 2025
commit 5ba881bd493d7fed43bb59889a0b3033dbe594a2
14 changes: 11 additions & 3 deletions test/lib/tailwindcss/commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ def setup
Dir.mktmpdir do |tmpdir|
root = Pathname.new(tmpdir)

# Create two engines
# Create multiple engines
engine_root1 = root.join('engine1')
engine_root2 = root.join('engine2')
engine_root3 = root.join('engine3')
FileUtils.mkdir_p(engine_root1)
FileUtils.mkdir_p(engine_root2)
FileUtils.mkdir_p(engine_root3)

engine1 = Class.new(Rails::Engine) do
define_singleton_method(:engine_name) { "test_engine1" }
Expand All @@ -155,7 +157,12 @@ def setup
define_singleton_method(:root) { engine_root2 }
end

# Create mock specs for both engines
engine3 = Class.new(Rails::Engine) do
define_singleton_method(:engine_name) { "test_engine3" }
define_singleton_method(:root) { engine_root3 }
end

# Create mock specs for engines
spec1 = Minitest::Mock.new
spec1.expect(:dependencies, [Gem::Dependency.new("tailwindcss-rails")])

Expand Down Expand Up @@ -183,7 +190,8 @@ def setup

find_by_name_results = {
"test_engine1" => spec1,
"test_engine2" => spec2
"test_engine2" => spec2,
"test_engine3" => spec3,
}

Gem::Specification.stub(:find_by_name, ->(name) { find_by_name_results[name] }) do
Expand Down