Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access metadata from before(:all) #6

Closed
dchelimsky opened this issue Mar 7, 2010 · 1 comment
Closed

access metadata from before(:all) #6

dchelimsky opened this issue Mar 7, 2010 · 1 comment

Comments

@dchelimsky
Copy link
Contributor

As of 2.0.0.beta.2, you can access the running example's metadata hash from an example or before/after(:each). Let's support accessing it from before/after(:all) as well - at least at the example group level. e.g.

describe "something" do
  before(:all) do
    running_example_group.metadata[:foo] = 'bar'
  end
  it "does something" do
    running_example.metadata[:example_group][:foo].should eq('bar")
    # or
    running_example_group.metadata[:foo].should eq("bar")
  end
end
@dchelimsky
Copy link
Contributor Author

Turns out this won't work for a number of reasons, so we'll need to solve for the use-case that spawned this in a different way. See http://groups.google.com/group/rspec/browse_thread/thread/5f1c4e64b6cdc956/

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant