aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_and_time_compatibility_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/date_and_time_compatibility_test.rb')
-rw-r--r--activesupport/test/core_ext/date_and_time_compatibility_test.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/activesupport/test/core_ext/date_and_time_compatibility_test.rb b/activesupport/test/core_ext/date_and_time_compatibility_test.rb
index 11cb1469da..180b3e12aa 100644
--- a/activesupport/test/core_ext/date_and_time_compatibility_test.rb
+++ b/activesupport/test/core_ext/date_and_time_compatibility_test.rb
@@ -1,6 +1,6 @@
-require 'abstract_unit'
-require 'active_support/time'
-require 'time_zone_test_helpers'
+require "abstract_unit"
+require "active_support/time"
+require "time_zone_test_helpers"
class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
include TimeZoneTestHelpers
@@ -10,12 +10,12 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
@date_time = DateTime.new(2016, 4, 23, 14, 11, 12, 0)
@utc_offset = 3600
@system_offset = -14400
- @zone = ActiveSupport::TimeZone['London']
+ @zone = ActiveSupport::TimeZone["London"]
end
def test_time_to_time_preserves_timezone
with_preserve_timezone(true) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = Time.new(2016, 4, 23, 15, 11, 12, 3600).to_time
assert_instance_of Time, time
@@ -27,7 +27,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_time_to_time_does_not_preserve_time_zone
with_preserve_timezone(false) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = Time.new(2016, 4, 23, 15, 11, 12, 3600).to_time
assert_instance_of Time, time
@@ -39,7 +39,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_datetime_to_time_preserves_timezone
with_preserve_timezone(true) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = DateTime.new(2016, 4, 23, 15, 11, 12, Rational(1,24)).to_time
assert_instance_of Time, time
@@ -51,7 +51,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_datetime_to_time_does_not_preserve_time_zone
with_preserve_timezone(false) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = DateTime.new(2016, 4, 23, 15, 11, 12, Rational(1,24)).to_time
assert_instance_of Time, time
@@ -63,7 +63,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_twz_to_time_preserves_timezone
with_preserve_timezone(true) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = ActiveSupport::TimeWithZone.new(@utc_time, @zone).to_time
assert_instance_of Time, time
@@ -83,7 +83,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_twz_to_time_does_not_preserve_time_zone
with_preserve_timezone(false) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = ActiveSupport::TimeWithZone.new(@utc_time, @zone).to_time
assert_instance_of Time, time
@@ -103,7 +103,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_string_to_time_preserves_timezone
with_preserve_timezone(true) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = "2016-04-23T15:11:12+01:00".to_time
assert_instance_of Time, time
@@ -115,7 +115,7 @@ class DateAndTimeCompatibilityTest < ActiveSupport::TestCase
def test_string_to_time_does_not_preserve_time_zone
with_preserve_timezone(false) do
- with_env_tz 'US/Eastern' do
+ with_env_tz "US/Eastern" do
time = "2016-04-23T15:11:12+01:00".to_time
assert_instance_of Time, time