Testing: Fix bug in VCR helper from a5d4cd8
In our test suite config, we have a helper to enable HTTP caching ("VCR cassettes") via RSpec metadata tags (from1ebddff
). This helper can potentially lead to confusing test failures, so we added an error message, hooking into RSpec::Support.notify_failure (froma5d4cd8
). This error message logic did not take the same exact arguments that RSpec::Support.notify_failure does, which led to errors like the one below: ArgumentError: wrong number of arguments (given 2, expected 1) # ./spec/support/vcr.rb:78:in `inject_advisory' # ./spec/support/vcr.rb:60:in `inject_advisory' # ./spec/support/vcr.rb:36:in `block in auto_record' # ./spec/support/vcr.rb:35:in `auto_record' This commit fixes the above error.
This commit is contained in:
parent
f69d7a0962
commit
5ffad2a7e7
1 changed files with 2 additions and 2 deletions
|
@ -53,8 +53,8 @@ module RSpec
|
||||||
module VCRHelper
|
module VCRHelper
|
||||||
def self.inject_advisory(example)
|
def self.inject_advisory(example)
|
||||||
# block argument is an #<RSpec::Expectations::ExpectationNotMetError>
|
# block argument is an #<RSpec::Expectations::ExpectationNotMetError>
|
||||||
define_method(:notify_failure) do |e|
|
define_method(:notify_failure) do |e, options = {}|
|
||||||
super(e.exception(VCR_ADVISORY + e.message))
|
super(e.exception(VCR_ADVISORY + e.message), options)
|
||||||
end
|
end
|
||||||
|
|
||||||
example.run
|
example.run
|
||||||
|
|
Loading…
Reference in a new issue