From 637356eb26119f01badf57c57e6b313c65457c70 Mon Sep 17 00:00:00 2001 From: Michael Glass Date: Tue, 22 Aug 2017 14:41:31 +0200 Subject: [PATCH] add metadata to test case --- spec/lib/rspec/retry_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/lib/rspec/retry_spec.rb b/spec/lib/rspec/retry_spec.rb index 316c37d..e71f61e 100644 --- a/spec/lib/rspec/retry_spec.rb +++ b/spec/lib/rspec/retry_spec.rb @@ -214,14 +214,14 @@ class SharedError < StandardError; end; RSpec.configuration.retry_callback = nil end - context 'should call retry_callback if failure' do + context 'if failure' do before(:all) do @retry_callback_called = false @example = nil @retry_attempts = 0 end - it do |example| + it 'should call retry callback', with_some: 'metadata' do |example| if @retry_attempts == 0 @retry_attempts += 1 expect(@retry_callback_called).to be(false) @@ -230,6 +230,7 @@ class SharedError < StandardError; end; elsif @retry_attempts > 0 expect(@retry_callback_called).to be(true) expect(@example).to eq(example) + expect(@example.metadata[:with_some]).to eq('metadata') end end end