Skip to content

Commit

Permalink
added test for register_odd replacing existing class
Browse files Browse the repository at this point in the history
  • Loading branch information
ohler55 committed Mar 8, 2015
1 parent 6e77c88 commit 41b9a1b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme

[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)

## Future Release 2.12.0
## Curent Release 2.12.0

- String formats for UTC time are now explitly UTC instead of offset of
zero. This fixes a problem with pre-2.2.0 Rubies that automatically convert
Expand Down
8 changes: 0 additions & 8 deletions notes
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
^c^d hide subtree
^c^s show subtree

- time
- object.c hat_num()
- for 1.8.7 have to create string and then call parse, not xmlschema (xmlschema always makes UTC)
- for 1.9 and above use Time.new()
- use oj_parse_id, not intern
- test
- check number parsing for big exp
- times with different zones - check string also


- streaming parser for scp and saj
Expand Down
7 changes: 7 additions & 0 deletions test/test_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,13 @@ def test_odd_string
dump_and_load(s, false)
end

def test_odd_date_replaced
Oj.register_odd(Date, Date, :jd, :jd)
json = Oj.dump(Date.new(2015, 3, 7), :mode => :object)
assert_equal(%|{"^O":"Date","jd":2457089}|, json)
dump_and_load(Date.new(2012, 6, 19), false)
end

def test_auto_string
s = AutoStrung.new("Pete", true)
dump_and_load(s, false)
Expand Down

0 comments on commit 41b9a1b

Please sign in to comment.