aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_ext_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-06-03 13:32:53 -0500
committerJoshua Peek <josh@joshpeek.com>2008-06-03 13:32:53 -0500
commitc08547d2266c75f0a82d06dd91c6d0500740e12e (patch)
treeafd294792deab652137c1d172e752882bbd91669 /activesupport/test/core_ext/date_ext_test.rb
parentda91450e687fe9faa7b0575062c2b2aacc261f68 (diff)
downloadrails-c08547d2266c75f0a82d06dd91c6d0500740e12e.tar.gz
rails-c08547d2266c75f0a82d06dd91c6d0500740e12e.tar.bz2
rails-c08547d2266c75f0a82d06dd91c6d0500740e12e.zip
Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved]
Diffstat (limited to 'activesupport/test/core_ext/date_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/date_ext_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb
index 11b6056047..ddfe1f904f 100644
--- a/activesupport/test/core_ext/date_ext_test.rb
+++ b/activesupport/test/core_ext/date_ext_test.rb
@@ -172,7 +172,7 @@ class DateExtCalculationsTest < Test::Unit::TestCase
def test_last_month_on_31st
assert_equal Date.new(2004, 2, 29), Date.new(2004, 3, 31).last_month
- end
+ end
def test_yesterday_constructor
assert_equal Date.today - 1, Date.yesterday
@@ -197,11 +197,11 @@ class DateExtCalculationsTest < Test::Unit::TestCase
def test_end_of_day
assert_equal Time.local(2005,2,21,23,59,59), Date.new(2005,2,21).end_of_day
end
-
+
def test_date_acts_like_date
assert Date.new.acts_like_date?
end
-
+
def test_xmlschema
with_env_tz 'US/Eastern' do
assert_match(/^1980-02-28T00:00:00-05:?00$/, Date.new(1980, 2, 28).xmlschema)
@@ -213,7 +213,7 @@ class DateExtCalculationsTest < Test::Unit::TestCase
end
end
end
-
+
uses_mocha 'TestDateCurrent' do
def test_current_returns_date_today_when_zone_default_not_set
with_env_tz 'US/Central' do
@@ -222,10 +222,10 @@ class DateExtCalculationsTest < Test::Unit::TestCase
assert_equal Date.new(1999, 12, 31), Date.current
end
end
-
+
def test_current_returns_time_zone_today_when_zone_default_set
silence_warnings do # silence warnings raised by tzinfo gem
- Time.zone_default = TimeZone['Eastern Time (US & Canada)']
+ Time.zone_default = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
with_env_tz 'US/Central' do
Time.stubs(:now).returns Time.local(1999, 12, 31, 23)
assert_equal Date.new(1999, 12, 31), Date.today
@@ -243,5 +243,5 @@ class DateExtCalculationsTest < Test::Unit::TestCase
yield
ensure
old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ')
- end
+ end
end