Skip to content

Commit

Permalink
Updated "verbose linting" test to allow for backtrace changes in Ruby…
Browse files Browse the repository at this point in the history
… 3.4

- file:   spec/acceptance/lint_spec.rb:188

Ruby 3.4 backtrace locations now include the object name
as well as the method name.

So "...`save!`" in 3.3, becomes "...'InvalidThing#save!'" in 3.4

The solution was to update the test regex to allow for either option:
  %r{#{__FILE__}:\d*:in ('InvalidThing#save!'|`save!')}
  • Loading branch information
CodeMeister committed Feb 1, 2025
1 parent afd6d25 commit 575d1e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/acceptance/lint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def save!
FactoryBot.lint(verbose: true)
}.to raise_error(
FactoryBot::InvalidFactoryError,
%r{#{__FILE__}:\d*:in `save!'}
%r{#{__FILE__}:\d*:in ('InvalidThing#save!'|`save!')}
)
end
end
Expand Down

0 comments on commit 575d1e6

Please # to comment.