Navigation Menu

Skip to content

Commit

Permalink
Add test for leap second
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed Jan 31, 2015
1 parent 437b414 commit 0df1267
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test-record.rb
Expand Up @@ -652,5 +652,25 @@ def test_to_json
}.to_json
assert_equal(expected, groonga.to_json)
end

def test_to_json_with_leap_second
ENV["TZ"] = "right/Japan"
created_at = Time.parse("2012-07-01T08:59:60+09:00")
values = {
"uri" => "http://groonga.org/",
"rate" => 5,
"comment" => "Great!",
"created_at" => created_at,
}
groonga = @bookmarks.add(values)
expected = {
"_id" => groonga.id,
"comment" => values["comment"],
"created_at" => created_at.iso8601,
"rate" => values["rate"],
"uri" => values["uri"],
}.to_json
assert_equal(expected, groonga.to_json)
end
end
end

0 comments on commit 0df1267

Please sign in to comment.