-
Notifications
You must be signed in to change notification settings - Fork 965
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
Ruby 2.0 tests #194
Ruby 2.0 tests #194
Changes from 7 commits
7040a45
66127fb
3f27f99
773010e
c77bfa2
b123ec2
ed0e877
9e778b1
494d95f
a0a07c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ rvm: | |
- 1.8.7 | ||
- ree | ||
- 1.9.3 | ||
- 2.0.0 | ||
notifications: | ||
email: false | ||
bundler_args: --without development |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -599,11 +599,11 @@ def self.name | |
end | ||
|
||
it 'should dup the proc on the child class' do | ||
imaginary_option = lambda { "This is a new lambda" } | ||
imaginary_option = lambda { 2 * 3.14 } | ||
@parent.default_options[:imaginary_option] = imaginary_option | ||
@parent.default_options[:imaginary_option].should be_equal imaginary_option | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be testing equality? Seems like it should be the same as below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% sure what you mean, my change tests the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought the point of changing the block and swapping out the equality check for the invocation check was because the equality check didn't work, but the @parent is still using the equality check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see what you mean, yea that makes perfect sense. |
||
@child1.default_options[:imaginary_option] | ||
@child1.default_options[:imaginary_option].should == imaginary_option | ||
@child1.default_options[:imaginary_option].call.should == imaginary_option.call | ||
@child1.default_options[:imaginary_option].should_not be_equal imaginary_option | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to test both, I think I would just move this one to a separate example, rather than as one in the huge list. I would then maybe just do an if RUBY_VERSION check around each of them. RUBY_VERSION >= '2.0.0' => multiple_choices? and < '2.0.0' multiple_choice?. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the real question is should the code be changing the method name per version of ruby, this might be confusion to users. The new variable name is consistant with the proper name of the response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, gotcha. I would think both should work. One version should alias to the other. What about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, too bad though, the beautiful dynamic method declaration will need hacks.