Skip to content

Commit bf693d0

Browse files
justin808claude
andcommitted
Fix packs_generator_spec tests for verbose mode changes
The verbose flag changes made pack generation output conditional on the REACT_ON_RAILS_VERBOSE environment variable. Updated the two failing tests to set this environment variable so they can verify the expected output is produced when packs are actually generated. Tests fixed: - "generate packs if a new component is added" - "generate packs if an old component is updated" Both tests now: 1. Set ENV["REACT_ON_RAILS_VERBOSE"] = "true" before generation 2. Run the pack generation 3. Clean up the environment variable This ensures backward compatibility with existing tests while supporting the new verbose mode functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 0fc24b0 commit bf693d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/dummy/spec/packs_generator_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,19 +413,25 @@ def self.rsc_support_enabled?
413413
it "generate packs if a new component is added" do
414414
create_new_component("NewComponent")
415415

416+
# Set verbose mode to see pack generation output
417+
ENV["REACT_ON_RAILS_VERBOSE"] = "true"
416418
expect do
417419
described_class.instance.generate_packs_if_stale
418420
end.to output(GENERATED_PACKS_CONSOLE_OUTPUT_REGEX).to_stdout
421+
ENV.delete("REACT_ON_RAILS_VERBOSE")
419422
FileUtils.rm "#{packer_source_path}/components/ComponentWithCommonOnly/ror_components/NewComponent.jsx"
420423
end
421424

422425
it "generate packs if an old component is updated" do
423426
FileUtils.rm component_pack
424427
create_new_component(component_name)
425428

429+
# Set verbose mode to see pack generation output
430+
ENV["REACT_ON_RAILS_VERBOSE"] = "true"
426431
expect do
427432
described_class.instance.generate_packs_if_stale
428433
end.to output(GENERATED_PACKS_CONSOLE_OUTPUT_REGEX).to_stdout
434+
ENV.delete("REACT_ON_RAILS_VERBOSE")
429435
end
430436

431437
def create_new_component(name)

0 commit comments

Comments
 (0)