Permalink
Browse files

AttributeMethodTest test fix #jruby

  • Loading branch information...
vishnuatrai authored and jonleighton committed May 31, 2011
1 parent 1e43bd9 commit 230f78875999ed566cbfc54c3b824420ea082f4b
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/test/cases/attribute_methods_test.rb
@@ -134,7 +134,11 @@ def test_read_attributes_before_type_cast
if current_adapter?(:MysqlAdapter)
def test_read_attributes_before_type_cast_on_boolean
bool = Boolean.create({ "value" => false })
- assert_equal 0, bool.reload.attributes_before_type_cast["value"]
+ if RUBY_PLATFORM =~ /java/
+ assert_equal 0, bool.reload.attributes_before_type_cast["value"]
+ else
+ assert_equal "0", bool.reload.attributes_before_type_cast["value"]
+ end
end
end

4 comments on commit 230f788

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 1, 2011

Member

Did you actually run this test before submitting the patch? It broke on MRI and presumably fixed nothing on JRuby because the conditions are the wrong way around.

Member

jonleighton replied Jun 1, 2011

Did you actually run this test before submitting the patch? It broke on MRI and presumably fixed nothing on JRuby because the conditions are the wrong way around.

@arunagw

This comment has been minimized.

Show comment
Hide comment
@arunagw

arunagw Jun 2, 2011

Member

@jonleighton

The Reason this broke master is that it's not for Master. It's for 3-0-stable.

Previously

in master : assert_equal 0, bool.reload.attributes_before_type_cast["value"]

In 3-0-stable : assert_equal "0", bool.reload.attributes_before_type_cast["value"]

That pull request is for only 3-0-stable. We ran all the tests for 3-0-stable.

Sending you a pull request for 3-0-stable. Cause 3-0-stable is broken now :-)

#1453

Now the Master looks fine. as you make the changes.

Cheers

Member

arunagw replied Jun 2, 2011

@jonleighton

The Reason this broke master is that it's not for Master. It's for 3-0-stable.

Previously

in master : assert_equal 0, bool.reload.attributes_before_type_cast["value"]

In 3-0-stable : assert_equal "0", bool.reload.attributes_before_type_cast["value"]

That pull request is for only 3-0-stable. We ran all the tests for 3-0-stable.

Sending you a pull request for 3-0-stable. Cause 3-0-stable is broken now :-)

#1453

Now the Master looks fine. as you make the changes.

Cheers

@arunagw

This comment has been minimized.

Show comment
Hide comment
@arunagw

arunagw Jun 2, 2011

Member

We didn't ran the tests after merged into master. Because with Jruby the Rails-Master is in very bad shape for ActiveRecord.

Member

arunagw replied Jun 2, 2011

We didn't ran the tests after merged into master. Because with Jruby the Rails-Master is in very bad shape for ActiveRecord.

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Jun 2, 2011

Member

Ok, my mistake, sorry. Looks like it's all sorted now.

Member

jonleighton replied Jun 2, 2011

Ok, my mistake, sorry. Looks like it's all sorted now.

Please sign in to comment.