summaryrefslogtreecommitdiff
path: root/test/test_time.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-30 01:38:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-30 01:38:41 +0000
commit205cf0140db1cf0bfc91cded8b9037cf2876eadf (patch)
treec13b78e0ab1d3fd1acfda5ec43eaba5d18b20445 /test/test_time.rb
parent365b32584156860da518f5920fcd14b7d4933d7e (diff)
test_time.rb: fix method to test
* test/test_time.rb (subtest_xmlschema_alias): test the specified method, not fixed name iso8601. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r--test/test_time.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_time.rb b/test/test_time.rb
index f39713b..ef09f7b 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -97,23 +97,23 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
def subtest_xmlschema_alias(method)
t = Time.utc(1985, 4, 12, 23, 20, 50, 520000)
s = "1985-04-12T23:20:50.52Z"
- assert_equal(t, Time.iso8601(s))
- assert_equal(s, t.iso8601(2))
+ assert_equal(t, Time.__send__(method, s))
+ assert_equal(s, t.__send__(method, 2))
t = Time.utc(1996, 12, 20, 0, 39, 57)
s = "1996-12-19T16:39:57-08:00"
- assert_equal(t, Time.iso8601(s))
+ assert_equal(t, Time.__send__(method, s))
# There is no way to generate time string with arbitrary timezone.
s = "1996-12-20T00:39:57Z"
- assert_equal(t, Time.iso8601(s))
+ assert_equal(t, Time.__send__(method, s))
assert_equal(s, t.iso8601)
t = Time.utc(1990, 12, 31, 23, 59, 60)
s = "1990-12-31T23:59:60Z"
- assert_equal(t, Time.iso8601(s))
+ assert_equal(t, Time.__send__(method, s))
# leap second is representable only if timezone file has it.
s = "1990-12-31T15:59:60-08:00"
- assert_equal(t, Time.iso8601(s))
+ assert_equal(t, Time.__send__(method, s))
begin
Time.at(-1)
@@ -122,7 +122,7 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
else
t = Time.utc(1937, 1, 1, 11, 40, 27, 870000)
s = "1937-01-01T12:00:27.87+00:20"
- assert_equal(t, Time.iso8601(s))
+ assert_equal(t, Time.__send__(method, s))
end
end