Skip to content

Commit d139027

Browse files
justin808claude
andcommitted
fix: Update test expectations and fix YAML parsing for Ruby 3.4
Two test fixes: 1. **PrerenderError test**: Updated expectation to match new error message format. The message now shows "💡 Tip: Set FULL_TEXT_ERRORS=true to see the full backtrace" instead of "The rest of the backtrace is hidden". 2. **Generator YAML parsing**: Fixed `Psych::AliasesNotEnabled` error in generator tests by adding `aliases: true` parameter to `YAML.load_file`. This is required in newer Ruby/Psych versions to parse YAML files with anchors and aliases. These are compatibility fixes for the improved error messages feature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 67ab7e4 commit d139027

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/generators/react_on_rails/base_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def configure_rspack_in_shakapacker
412412
puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow
413413

414414
# Parse YAML config properly to avoid fragile regex manipulation
415-
config = YAML.load_file(shakapacker_config_path)
415+
config = YAML.load_file(shakapacker_config_path, aliases: true)
416416

417417
# Update default section
418418
config["default"] ||= {}

spec/react_on_rails/prender_error_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module ReactOnRails
6868
# Ruby version compatibility: match any backtrace reference to the test file
6969
backtrace_pattern = /prender_error_spec\.rb:\d+:in ['`]block \(\d+ levels\) in <module:ReactOnRails>['`]/
7070
expect(message).to match(backtrace_pattern)
71-
expect(message).to include("The rest of the backtrace is hidden")
71+
expect(message).to include("💡 Tip: Set FULL_TEXT_ERRORS=true to see the full backtrace")
7272
end
7373
end
7474
end

0 commit comments

Comments
 (0)