Skip to content

Loading…

Expose metadata in around hooks #221

Closed
dchelimsky opened this Issue · 1 comment

1 participant

@dchelimsky
RSpec member

Need a way to make decisions in around hooks based on metadata content.

RSpec.configure do |c|
  c.around do |example, metadata|
    if metadata[:foo] == :bar
      Wrapper.do_something(&example)
    else
      Wrapper.do_something_else(&example)
    end
  end
end

or


RSpec.configure do |c|
c.around do |example|
if example.metadata[:foo] == :bar
Wrapper.do_something(&example)
else
Wrapper.do_something_else(&example)
end
end
end

@dchelimsky
RSpec member

Expose example.metadata in around hooks

@timcharper timcharper pushed a commit to timcharper/rspec-core that referenced this issue
@dchelimsky dchelimsky Expose example.metadata in around hooks
- Closes #221.
b6a7897
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.