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

add spec for inline rescue #3273

Closed
wants to merge 2 commits into from

Conversation

ashanbrown
Copy link

Demonstrate the failure in #3272

@yorickpeterse
Copy link
Contributor

A few questions/remarks:

  1. Why is this spec in spec/ruby/core/thread? It's not related to the Thread class, it should probably go in spec/ruby/language instead, although I'm not exactly sure in what file.
  2. Please remove the empty commit used to trigger a Travis build
  3. The spec descriptions need to be rewritten so it's more clear what they are about. For example, the spec isn't just testing inline rescues, it's testing the combination of X ||= Y rescue Z. I'll leave some code comments with some examples.

@@ -0,0 +1,9 @@
require File.expand_path('../../../shared/kernel/raise', __FILE__)

describe "inline rescue" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since at its core this spec is testing if ||= works correctly with a rescue, I'd say this description should be something along the lines of "Optional assignments".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this exists: https://github.com/rubinius/rubinius/blob/master/spec/ruby/language/variables_spec.rb#L4

Since this file is already pretty big I'd suggest putting the specs in spec/ruby/language/optional_assignments_spec.rb, otherwise they can be added as an extra describe block in this existing file.

@jc00ke
Copy link
Member

jc00ke commented Jan 5, 2015

Should there be a tag? Don't we know this is going to fail?

require File.expand_path('../../../shared/kernel/raise', __FILE__)

describe "inline rescue" do
it "properly executes compound assignment operators" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be something along the lines of "does not overwrite a variable when using an inline rescue". The idea is to clearly state that:

  1. The spec should do something that doesn't overwrite a value
  2. This should not occur when using an inline rescue

@ashanbrown
Copy link
Author

Sorry, I didn't mean for this pull request to be taken as is. I just wanted to trigger a travis build to show the failure. Sorry not to be clear about that. I'm really not familiar with rubinious or how it is organized. Unless you really need my assistance, I hope you and other contributors can take it from here. Thanks.

@yorickpeterse
Copy link
Contributor

@dontfidget Ah ok, that's perfectly fine as well. Thanks for at least looking into this :)

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

3 participants