-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can't change block context if defined within module context #229
Comments
I'm starting to think that |
Yet the only way to make any sensible DSL possible that doesn't put all methods into the global namespace. |
But you can always carry the object as a block argument. More verbose but it's much easier to understand the code and doesn't lead to ambiguities. |
I'm toying with a testsuite implementation that's closer to something like RSpec 3, so run order randomization, possibly single context execution, minimal global methods or core extensions, before/after callbacks and so on. Spec.describe "foo" do |c|
c.context "bar" do |c|
c.before(:each) do |b|
@foo = true
end
c.it "baz" do |e|
e.expect(@foo).to e.be_false
end
end
end Or would you? |
I guess not :-) |
We also have code in our specs that uses that feature, something like: assert_type("1 + 2") { int32 } So, yes, it's a nice feature to have. |
The text was updated successfully, but these errors were encountered: