Skip to content

Commit 8852a82

Browse files
Merge pull request ruby-git#98 from ohtake/defensive-against-timezones
Make tests defensive against timezones
2 parents b36b6fb + 39b6cb0 commit 8852a82

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/units/test_bare.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def test_commit
1818
assert_equal(1, o.parents.size)
1919
assert_equal('scott Chacon', o.author.name)
2020
assert_equal('schacon@agadorsparticus.corp.reactrix.com', o.author.email)
21-
assert_equal('11-08-07', o.author.date.strftime("%m-%d-%y"))
22-
assert_equal('11-08-07', o.author_date.strftime("%m-%d-%y"))
21+
assert_equal('11-08-07', o.author.date.getutc.strftime("%m-%d-%y"))
22+
assert_equal('11-08-07', o.author_date.getutc.strftime("%m-%d-%y"))
2323
assert_equal('scott Chacon', o.committer.name)
24-
assert_equal('11-08-07', o.committer_date.strftime("%m-%d-%y"))
25-
assert_equal('11-08-07', o.date.strftime("%m-%d-%y"))
24+
assert_equal('11-08-07', o.committer_date.getutc.strftime("%m-%d-%y"))
25+
assert_equal('11-08-07', o.date.getutc.strftime("%m-%d-%y"))
2626
assert_equal('test', o.message)
2727

2828
assert_equal('tags/v2.5', o.parent.name)

tests/units/test_object.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def test_commit
2323
assert_equal(1, o.parents.size)
2424
assert_equal('scott Chacon', o.author.name)
2525
assert_equal('schacon@agadorsparticus.corp.reactrix.com', o.author.email)
26-
assert_equal('11-08-07', o.author.date.strftime("%m-%d-%y"))
27-
assert_equal('11-08-07', o.author_date.strftime("%m-%d-%y"))
26+
assert_equal('11-08-07', o.author.date.getutc.strftime("%m-%d-%y"))
27+
assert_equal('11-08-07', o.author_date.getutc.strftime("%m-%d-%y"))
2828
assert_equal('scott Chacon', o.committer.name)
29-
assert_equal('11-08-07', o.committer_date.strftime("%m-%d-%y"))
30-
assert_equal('11-08-07', o.date.strftime("%m-%d-%y"))
29+
assert_equal('11-08-07', o.committer_date.getutc.strftime("%m-%d-%y"))
30+
assert_equal('11-08-07', o.date.getutc.strftime("%m-%d-%y"))
3131
assert_equal('test', o.message)
3232

3333
assert_equal('tags/v2.5', o.parent.name)

0 commit comments

Comments
 (0)