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

treat_symbols_as_metadata_keys_with_true_values doesn't effect example.metadata in around block #956

Closed
wants to merge 2 commits into from

Conversation

docwhat
Copy link

@docwhat docwhat commented Jun 28, 2013

If you have treat_symbols_as_metadata_keys_with_true_values set and you have
an around hook, the example Proc's metadata won't have keys set as true
when passed from the example definition.

I have written a test that demonstrates the problem.

I also fixed a minor typo in a separate commit.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 366bacd on docwhat:around-bug into f844a01 on rspec:master.

@docwhat
Copy link
Author

docwhat commented Jun 28, 2013

Whups. This was my fault in my code. I forgot to require spec_helper.

However, I suspect the test concept is legit, even if it is obvious I made a mistake; can you not set configuration that way?.

I'm 100% okay with someone taking my code and fixing and committing it with them as the author/committer.

I'm also 100% okay if someone points me in the right direction to fix the test.

Ciao!

@cupakromer
Copy link
Member

@docwhat are you saying this cuke should pass? I would expect it to fail. Since your sample spec doesn't define the metadata foo, I wouldn't expect it to be true.

@myronmarston
Copy link
Member

FWIW, I just tried this and it passes:

describe "something" do
  around(:each) do |example|
   example.metadata[:bar].should be_true
  end

  it "does nothing", :bar do
  end
end

I'm going to close this as it's not clear what the bug is (or if there even is one), but I'll be happy to re-open if I'm not understanding something.

@docwhat docwhat deleted the around-bug branch April 1, 2017 11:50
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

Successfully merging this pull request may close these issues.

None yet

4 participants