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

test fixes for jruby #1430

Merged
merged 2 commits into from Jun 1, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion activerecord/test/cases/attribute_methods_test.rb
Expand Up @@ -124,7 +124,12 @@ 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/
#JRuby will returns the value before typecast as integer
assert_equal 0, bool.reload.attributes_before_type_cast["value"]
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind adding another comment before this line saying something like "JRuby will returns the value before typecast as integer" or something like that? I think we might forget why this condition has to be exists at later date.

else
assert_equal "0", bool.reload.attributes_before_type_cast["value"]
end
end
end

Expand Down