Skip to content

Commit

Permalink
Relax the exception message check
Browse files Browse the repository at this point in the history
We don't actually care about the specific letters used in Ruby's
`NoMethodError` exception message. We do care about the important parts,
though: the method name, the object, and that "Did you mean" worked.
  • Loading branch information
mike-burns committed Dec 26, 2023
1 parent 524f694 commit 0c46150
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec/factory_bot/definition_proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@

expect(&invalid_call).to raise_error(
NoMethodError,
"undefined method 'static_attributes_are_gone' in 'broken' factory\n" \
"Did you mean? 'static_attributes_are_gone { \"true\" }'\n"
/'static_attributes_are_gone'.*'broken' factory.*Did you mean\? 'static_attributes_are_gone \{ "true" \}'/m
)
end
end
Expand Down

0 comments on commit 0c46150

Please sign in to comment.