-
-
Notifications
You must be signed in to change notification settings - Fork 629
Fix main generator pretend spec isolation #4147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3717,12 +3717,20 @@ class ActiveSupport::TestCase | |
| it "does not read the copied Redux Tailwind entry in pretend mode" do | ||
| redux_generator = redux_generator_fixture(pretend: true, tailwind: true) | ||
| client_entry = "app/javascript/src/HelloWorldApp/ror_components/HelloWorldApp.client.jsx" | ||
| simulate_existing_file("config/shakapacker.yml", <<~YAML) | ||
| default: &default | ||
| source_path: app/javascript | ||
|
|
||
| development: | ||
| <<: *default | ||
| YAML | ||
|
|
||
| allow(redux_generator).to receive(:copy_file) | ||
| allow(redux_generator).to receive(:gsub_file) | ||
| allow(redux_generator).to receive(:prepend_to_file) | ||
| allow(File).to receive(:read).and_call_original | ||
|
|
||
| expect(File).not_to receive(:read) | ||
| expect(File).not_to receive(:read).with(File.join(destination_root, client_entry)) | ||
| expect(redux_generator).to receive(:say_status) | ||
| .with(:pretend, "Would add Tailwind stylesheet import to #{client_entry}", :yellow) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the key correctness fix: |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimal YAML here (only
source_path, nosource_entry_pathor other keys) is intentional and correct for this test — only the source path lookup is exercised. For reference,simulate_preinstalled_shakapackerin the support helper uses a full fixture with all keys. The difference is fine here sincecopy_base_filesin pretend mode only needs to resolve the source path.