lib/rspec/sorbet/instance_doubles.rb in rspec-sorbet-1.2.0 vs lib/rspec/sorbet/instance_doubles.rb in rspec-sorbet-1.2.1
- old
+ new
@@ -58,10 +58,11 @@
end
def call_validation_error_handler(_signature, opts)
should_raise = true
- if opts[:pretty_message].match?(INSTANCE_VERIFYING_DOUBLE_OR_INSTANCE_DOUBLE)
+ message = opts.fetch(:pretty_message, opts.fetch(:message, ''))
+ if message.match?(INSTANCE_VERIFYING_DOUBLE_OR_INSTANCE_DOUBLE)
typing = opts[:type]
value = opts[:value].is_a?(Array) ? opts[:value].first : opts[:value]
target = value.instance_variable_get(:@doubled_module).target
case typing