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

Only require power_assert if version > 1.8.7 #71

Closed
wants to merge 1 commit into from

Conversation

estolfo
Copy link

@estolfo estolfo commented Aug 4, 2014

The power_assert gem uses hash syntax that is not valid in Ruby version 1.8.7

I've made two changes:

  1. Only require the power_assert gem if Ruby version is > 1.8.7
  2. Stick to hash syntax valid in 1.8.7, as test-unit should support back to this version. I realize that line 135 won't even run in version 1.8.7 because PowerAssert wouldn't be defined, but syntax should be consistent, until the test-unit gem says it doesn't support 1.8.7.

kou added a commit that referenced this pull request Aug 5, 2014
GitHub: #71

Patch by estolfo. Thanks!!!
@kou
Copy link
Member

kou commented Aug 5, 2014

Thanks for your report!

Only require the power_assert gem if Ruby version is > 1.8.7

It isn't needed because we rescue SyntaxError.

So we don't merge this change.

Stick to hash syntax valid in 1.8.7, as test-unit should support back to this version. I realize that line 135 won't even run in version 1.8.7 because PowerAssert wouldn't be defined, but syntax should be consistent, until the test-unit gem says it doesn't support 1.8.7.

We don't support 1.8.7 actively because 1.8.7 died.

But your change is small. So we've merged it.

@kou kou closed this Aug 5, 2014
@kou
Copy link
Member

kou commented Aug 5, 2014

I've released 3.0.1. Please try it.

@estolfo
Copy link
Author

estolfo commented Aug 5, 2014

Thank @kou

Maybe you can change the gemspec so that you officially state that you don't support 1.8.7 ?
It should show up in rubygems as well http://rubygems.org/gems/test-unit

@kou
Copy link
Member

kou commented Aug 5, 2014

Maybe you can change the gemspec so that you officially state that you don't support 1.8.7 ?

Yes. I know about it.
But we don't use it because we support all alive Ruby versions. :-)

Ruby 1.8.7 died. So "we don't support 1.8.7" is the default. We don't say about it explicitly.

@estolfo
Copy link
Author

estolfo commented Aug 5, 2014

ah, I see what you're saying. ok, make sense !

On Tue, Aug 5, 2014 at 3:31 PM, Kouhei Sutou notifications@github.com
wrote:

Maybe you can change the gemspec so that you officially state that you
don't support 1.8.7 ?

Yes. I know about it.
But we don't use it because we support all alive Ruby versions. :-)

Ruby 1.8.7 died. So "we don't support 1.8.7" is the default. We don't say
about it explicitly.


Reply to this email directly or view it on GitHub
#71 (comment).

@kou
Copy link
Member

kou commented Aug 5, 2014

ah, I see what you're saying. ok, make sense !

Thanks. :-)

@estolfo
Copy link
Author

estolfo commented Aug 8, 2014

Hi again @kou
I'm actually seeing a change in the way assert works when upgrading from 2.5.5 to 3.0.1. I'm verifying that an object is not nil by doing:

assert an_object

After upgrading, it seems to be calling == on an_object somewhere. Am I using assert incorrectly ?

@kou
Copy link
Member

kou commented Aug 8, 2014

Could you show a sample test code that works on my environment?

@kou
Copy link
Member

kou commented Aug 8, 2014

The follwoing reproduces your problem?

require "test-unit"

class X < Test::Unit::TestCase
  def test_x
    assert 10
  end
end

@estolfo
Copy link
Author

estolfo commented Aug 8, 2014

If you scroll down in this test output, you can see that it's trying to compare the response['lastOp'] to something (which is #Object:0x7f8c85b9b4a0)

We were using this line just to validate that the value at 'lastOp' was not nil.

https://jenkins.10gen.com/view/Ruby/job/mongo-ruby-driver-emilys-fork/6/mongodb_server=22-release,os_arch=linux64,ruby_language_version=1.8.7,test_type=replica-set/console

kou added a commit that referenced this pull request Aug 8, 2014
Argument object's `==` may be broken. :<

GitHub: #71

Reported by Emily. Thanks!!!
@kou
Copy link
Member

kou commented Aug 8, 2014

Thanks. eb7af08 will solve your problem.

But it is a bug of bson gem. It seems that the latest bson gem fixes the bug. Maybe, bson gem what you used is old. https://github.com/mongodb/bson-ruby/blob/master/lib/bson/timestamp.rb#L51 is needed.

@estolfo
Copy link
Author

estolfo commented Aug 8, 2014

Great, thanks @kou
I'm also responsible for the bson gem, so thanks for pointing out where the issue was = )

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.

2 participants