aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-02-17 00:35:49 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-02-17 00:35:49 +0000
commit4a643f686afc3c8d0d3d9773e418cf9aed670107 (patch)
tree15e2e7a0644a22ebb9c3d9b43ce2e9511c024a5b /activesupport/test
parent25e139e545f11c7764abe250f8f33d58874516d7 (diff)
downloadrails-4a643f686afc3c8d0d3d9773e418cf9aed670107.tar.gz
rails-4a643f686afc3c8d0d3d9773e418cf9aed670107.tar.bz2
rails-4a643f686afc3c8d0d3d9773e418cf9aed670107.zip
Adding TimeWithZone#between?
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index 3421b85e60..c93d6157e7 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -116,6 +116,11 @@ uses_tzinfo 'TimeWithZoneTest' do
assert_equal(-1, @twz <=> ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1, 0, 0, 1), TimeZone['UTC'] ))
end
+ def test_between?
+ assert @twz.between?(Time.utc(1999,12,31,23,59,59), Time.utc(2000,1,1,0,0,1))
+ assert_equal false, @twz.between?(Time.utc(2000,1,1,0,0,1), Time.utc(2000,1,1,0,0,2))
+ end
+
def test_eql?
assert @twz.eql?(Time.utc(2000))
assert @twz.eql?( ActiveSupport::TimeWithZone.new(Time.utc(2000), TimeZone["Hawaii"]) )