diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:03:25 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:10:53 +0200 |
commit | a731125f12c5834de7eae3455fad63ea4d348034 (patch) | |
tree | 0ada76c652c1a2a1fd68cdbecf5adc2df6beeb51 /activesupport/test/core_ext/date_and_time_compatibility_test.rb | |
parent | d66e7835bea9505f7003e5038aa19b6ea95ceea1 (diff) | |
download | rails-a731125f12c5834de7eae3455fad63ea4d348034.tar.gz rails-a731125f12c5834de7eae3455fad63ea4d348034.tar.bz2 rails-a731125f12c5834de7eae3455fad63ea4d348034.zip |
applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
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.rb | 24 |
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 |