From 4c242e6d33237a20f272e75db620a53e4fe9c2ab Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 3 May 2013 11:29:35 -0700 Subject: Squashed commit of the following: commit 2683de5da85135e8d9fe48593ff6167db9d64b18 Author: Aaron Patterson Date: Fri May 3 11:29:20 2013 -0700 cannot support infinite ranges right now commit cebb6acef2c3957f975f6db4afd849e535126253 Author: Aaron Patterson Date: Fri May 3 11:26:12 2013 -0700 reverting infinity comparison commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea Author: Aaron Patterson Date: Fri May 3 11:23:28 2013 -0700 Revert "Added ability to compare date/time with infinity" This reverts commit 38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb activesupport/test/core_ext/date_ext_test.rb activesupport/test/core_ext/date_time_ext_test.rb activesupport/test/core_ext/numeric_ext_test.rb activesupport/test/core_ext/time_ext_test.rb activesupport/test/core_ext/time_with_zone_test.rb commit 0d799a188dc12b18267fc8421675729917610047 Author: Aaron Patterson Date: Fri May 3 11:18:53 2013 -0700 Revert "Refactor infinite comparable definition a bit" This reverts commit dd3360e05e4909f2f0c74a624cccc2def688f828. commit 42dec90e49745bbfae546f0560b8783f6b48b074 Author: Aaron Patterson Date: Fri May 3 11:18:47 2013 -0700 Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module" This reverts commit 7003e71c13c53ec3d34250560fbf80b8381df693. --- activesupport/test/core_ext/numeric_ext_test.rb | 54 ------------------------- 1 file changed, 54 deletions(-) (limited to 'activesupport/test/core_ext/numeric_ext_test.rb') diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb index 3744d50864..f22ae3ccac 100644 --- a/activesupport/test/core_ext/numeric_ext_test.rb +++ b/activesupport/test/core_ext/numeric_ext_test.rb @@ -441,57 +441,3 @@ class NumericExtFormattingTest < ActiveSupport::TestCase assert_equal '1 Million', BigDecimal("1000010").to_s(:human) end end - -class NumericExtBehaviorTest < ActiveSupport::TestCase - def setup - @inf = BigDecimal.new('Infinity') - end - - def test_compare_infinity_with_date - assert_equal(-1, -Float::INFINITY <=> Date.today) - assert_equal(1, Float::INFINITY <=> Date.today) - assert_equal(-1, -@inf <=> Date.today) - assert_equal(1, @inf <=> Date.today) - end - - def test_compare_infinty_with_infinty - assert_equal(-1, -Float::INFINITY <=> Float::INFINITY) - assert_equal(1, Float::INFINITY <=> -Float::INFINITY) - assert_equal(0, Float::INFINITY <=> Float::INFINITY) - assert_equal(0, -Float::INFINITY <=> -Float::INFINITY) - - assert_equal(-1, -Float::INFINITY <=> BigDecimal::INFINITY) - assert_equal(1, Float::INFINITY <=> -BigDecimal::INFINITY) - assert_equal(0, Float::INFINITY <=> BigDecimal::INFINITY) - assert_equal(0, -Float::INFINITY <=> -BigDecimal::INFINITY) - - assert_equal(-1, -BigDecimal::INFINITY <=> Float::INFINITY) - assert_equal(1, BigDecimal::INFINITY <=> -Float::INFINITY) - assert_equal(0, BigDecimal::INFINITY <=> Float::INFINITY) - assert_equal(0, -BigDecimal::INFINITY <=> -Float::INFINITY) - end - - def test_compare_infinity_with_time - assert_equal(-1, -Float::INFINITY <=> Time.now) - assert_equal(1, Float::INFINITY <=> Time.now) - assert_equal(-1, -@inf <=> Time.now) - assert_equal(1, @inf <=> Time.now) - end - - def test_compare_infinity_with_datetime - assert_equal(-1, -Float::INFINITY <=> DateTime.now) - assert_equal(1, Float::INFINITY <=> DateTime.now) - assert_equal(-1, -@inf <=> DateTime.now) - assert_equal(1, @inf <=> DateTime.now) - end - - def test_compare_infinity_with_twz - time_zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)'] - twz = ActiveSupport::TimeWithZone.new(Time.now, time_zone) - - assert_equal(-1, -Float::INFINITY <=> twz) - assert_equal(1, Float::INFINITY <=> twz) - assert_equal(-1, -@inf <=> twz) - assert_equal(1, @inf <=> twz) - end -end -- cgit v1.2.3