From 0c461509f8d3c86603d40c4cbd41c9dd46e39493 Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Tue, 26 Dec 2023 12:33:49 -0500 Subject: [PATCH] Relax the exception message check 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. --- spec/factory_bot/definition_proxy_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/factory_bot/definition_proxy_spec.rb b/spec/factory_bot/definition_proxy_spec.rb index 0a291a62..80272bcb 100644 --- a/spec/factory_bot/definition_proxy_spec.rb +++ b/spec/factory_bot/definition_proxy_spec.rb @@ -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