Expose metadata in around hooks #221

Closed
dchelimsky opened this Issue Nov 9, 2010 · 1 comment

Comments

Projects
None yet
1 participant
@dchelimsky
Member

dchelimsky commented Nov 9, 2010

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

This comment has been minimized.

Show comment
Hide comment
@dchelimsky

dchelimsky Nov 19, 2010

Member

Expose example.metadata in around hooks

Member

dchelimsky commented Nov 19, 2010

Expose example.metadata in around hooks

timcharper pushed a commit to timcharper/rspec-core that referenced this issue Aug 19, 2011

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment