aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-05-31 18:18:14 +0100
committerJon Leighton <j@jonathanleighton.com>2011-05-31 18:18:14 +0100
commit0bb8429e71662aedc36ed232748d62442e74a154 (patch)
treed8aaf67fbf2443fd272f9ab53340201840e05ed6 /activerecord/test
parent021e4f16b7db21d397196d9e1c1a693935e1e371 (diff)
downloadrails-0bb8429e71662aedc36ed232748d62442e74a154.tar.gz
rails-0bb8429e71662aedc36ed232748d62442e74a154.tar.bz2
rails-0bb8429e71662aedc36ed232748d62442e74a154.zip
Reduce test noise
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/timestamp_test.rb34
1 files changed, 14 insertions, 20 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index 22d4cac422..7505b94187 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -14,30 +14,24 @@ class TimestampTest < ActiveRecord::TestCase
@previously_updated_at = @developer.updated_at
end
- def test_load_infinity_and_beyond
- unless current_adapter?(:PostgreSQLAdapter)
- return skip("only tested on postgresql")
+ if current_adapter?(:PostgreSQLAdapter)
+ def test_load_infinity_and_beyond
+ d = Developer.find_by_sql("select 'infinity'::timestamp as updated_at")
+ assert d.first.updated_at.infinite?, 'timestamp should be infinite'
+
+ d = Developer.find_by_sql("select '-infinity'::timestamp as updated_at")
+ time = d.first.updated_at
+ assert time.infinite?, 'timestamp should be infinite'
+ assert_operator time, :<, 0
end
- d = Developer.find_by_sql("select 'infinity'::timestamp as updated_at")
- assert d.first.updated_at.infinite?, 'timestamp should be infinite'
+ def test_save_infinity_and_beyond
+ d = Developer.create!(:name => 'aaron', :updated_at => 1.0 / 0.0)
+ assert_equal(1.0 / 0.0, d.updated_at)
- d = Developer.find_by_sql("select '-infinity'::timestamp as updated_at")
- time = d.first.updated_at
- assert time.infinite?, 'timestamp should be infinite'
- assert_operator time, :<, 0
- end
-
- def test_save_infinity_and_beyond
- unless current_adapter?(:PostgreSQLAdapter)
- return skip("only tested on postgresql")
+ d = Developer.create!(:name => 'aaron', :updated_at => -1.0 / 0.0)
+ assert_equal(-1.0 / 0.0, d.updated_at)
end
-
- d = Developer.create!(:name => 'aaron', :updated_at => 1.0 / 0.0)
- assert_equal(1.0 / 0.0, d.updated_at)
-
- d = Developer.create!(:name => 'aaron', :updated_at => -1.0 / 0.0)
- assert_equal(-1.0 / 0.0, d.updated_at)
end
def test_saving_a_changed_record_updates_its_timestamp