Skip to content

Commit

Permalink
add metadata to test case
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglass committed Aug 22, 2017
1 parent 863f561 commit 637356e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/lib/rspec/retry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 637356e

Please sign in to comment.