Created
June 27, 2019 16:45
-
-
Save pariser/db98723c0b480ae82eb5c946b19f23dc to your computer and use it in GitHub Desktop.
sorbet rspec ignore doubles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T::Configuration.call_validation_error_handler = lambda do |signature, opts| | |
method_file, method_line = signature.method.source_location | |
location = opts[:location] | |
suffix = "Caller: #{location.path}:#{location.lineno}\n" \ | |
"Definition: #{method_file}:#{method_line}" | |
error_message = "#{opts[:kind]}#{opts[:name] ? " '#{opts[:name]}'" : ''}: #{opts[:message]}\n#{suffix}" | |
break if opts[:value].is_a?(RSpec::Mocks::Double) | |
raise TypeError.new(error_message) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment