From 5ffad2a7e7e402ae37d33ca94a5d70ce07af6ab6 Mon Sep 17 00:00:00 2001 From: Ryan Lue Date: Wed, 19 Feb 2020 19:21:52 +0800 Subject: [PATCH] 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 (from 1ebddff). This helper can potentially lead to confusing test failures, so we added an error message, hooking into RSpec::Support.notify_failure (from a5d4cd8). 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. --- spec/support/vcr.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb index 9f72353b8..e805226ac 100644 --- a/spec/support/vcr.rb +++ b/spec/support/vcr.rb @@ -53,8 +53,8 @@ module RSpec module VCRHelper def self.inject_advisory(example) # block argument is an # - define_method(:notify_failure) do |e| - super(e.exception(VCR_ADVISORY + e.message)) + define_method(:notify_failure) do |e, options = {}| + super(e.exception(VCR_ADVISORY + e.message), options) end example.run