aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/time_zone_test.rb
diff options
context:
space:
mode:
authorRonak Jangir <ronakjangir47@gmail.com>2015-06-04 23:55:45 +0530
committerRonak Jangir <ronakjangir47@gmail.com>2015-06-07 19:18:58 +0530
commit81d2ce96d0b41ccf4c4570a00906098229e34863 (patch)
tree741c33c56481ea2bca823f09b8dece1b05d60411 /activesupport/test/time_zone_test.rb
parent228e3f01cb7cc5d0b51311c5c0185b878c4853cb (diff)
downloadrails-81d2ce96d0b41ccf4c4570a00906098229e34863.tar.gz
rails-81d2ce96d0b41ccf4c4570a00906098229e34863.tar.bz2
rails-81d2ce96d0b41ccf4c4570a00906098229e34863.zip
Removed mocha stubbing in active_support
Diffstat (limited to 'activesupport/test/time_zone_test.rb')
-rw-r--r--activesupport/test/time_zone_test.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb
index 5e0474f449..34bb0e2995 100644
--- a/activesupport/test/time_zone_test.rb
+++ b/activesupport/test/time_zone_test.rb
@@ -252,9 +252,10 @@ class TimeZoneTest < ActiveSupport::TestCase
def test_parse_with_incomplete_date
zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
- zone.stubs(:now).returns zone.local(1999,12,31)
- twz = zone.parse('19:00:00')
- assert_equal Time.utc(1999,12,31,19), twz.time
+ zone.stub(:now, zone.local(1999,12,31)) do
+ twz = zone.parse('19:00:00')
+ assert_equal Time.utc(1999,12,31,19), twz.time
+ end
end
def test_parse_with_day_omitted
@@ -284,9 +285,10 @@ class TimeZoneTest < ActiveSupport::TestCase
def test_parse_with_missing_time_components
zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
- zone.stubs(:now).returns zone.local(1999, 12, 31, 12, 59, 59)
- twz = zone.parse('2012-12-01')
- assert_equal Time.utc(2012, 12, 1), twz.time
+ zone.stub(:now, zone.local(1999, 12, 31, 12, 59, 59)) do
+ twz = zone.parse('2012-12-01')
+ assert_equal Time.utc(2012, 12, 1), twz.time
+ end
end
def test_parse_with_javascript_date