This repository was archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
This repository was archived by the owner on Jun 3, 2023. It is now read-only.
Update oj to a more up-to-date version #28
Copy link
Copy link
Open
Description
Problem statement
- we use
transit-jsonin a large Rails application. - like
transit-ruby, some of the other gems we use also rely on theojgem. - we could not update some of those gems because they require at least version 3 of
oj, which conflicts withtransit-ruby'sojrequirement ("~> 2.18").
Proposed solution
- I forked this gem and updated
ojto3.10.16here: https://github.com/paulkoegel/transit-ruby to resolve our issue. Specs are still green. Changes: master...paulkoegel:master - It would be nice to get this change into the main repo.
FYI: Related issue (this has been fixed, specs are green again with oj version 3.10.16, which my fork uses now, leaving only for reference in case someone encounters this issue / it reappears in the future)
- The latest versions of
oj, 3.10.5 and 3.10.6 (there is no 3.10.4), break the specs oftransit-json. It looks to me like this might have been caused by thisojchange: ohler55/oj@ebfc1ce and spec expectations intransit-rubywould have to be updated to work with the latest versions ofoj.
Failures:
1) JSON exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.json
Failure/Error: assert { exemplar.expected_value == actual_value }
Expected (exemplar.expected_value == actual_value), but
[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34 ]
[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
^
exemplar.expected_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]
exemplar is #<struct Exemplar name="doubles_interesting", expected_value=[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]>
actual_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
Shared Example Group: "exemplars" called from ./spec/transit/exemplar_spec.rb:146
# ./spec/transit/exemplar_spec.rb:135:in `block (2 levels) in verify_exemplar'
# ./spec/transit/exemplar_spec.rb:133:in `open'
# ./spec/transit/exemplar_spec.rb:133:in `block in verify_exemplar'
2) JSON-VERBOSE exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.verbose.json
Failure/Error: assert { exemplar.expected_value == actual_value }
Expected (exemplar.expected_value == actual_value), but
[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34 ]
[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
^
exemplar.expected_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]
exemplar is #<struct Exemplar name="doubles_interesting", expected_value=[-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626e-34]>
actual_value is [-3.14159, 3.14159, 400000000000.0, 299800000.0, 6.626000000000001e-34]
Shared Example Group: "exemplars" called from ./spec/transit/exemplar_spec.rb:150
# ./spec/transit/exemplar_spec.rb:135:in `block (2 levels) in verify_exemplar'
# ./spec/transit/exemplar_spec.rb:133:in `open'
# ./spec/transit/exemplar_spec.rb:133:in `block in verify_exemplar'
Finished in 0.58072 seconds (files took 0.52754 seconds to load)
909 examples, 2 failures
Failed examples:
rspec './spec/transit/exemplar_spec.rb[1:23]' # JSON exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.json
rspec './spec/transit/exemplar_spec.rb[2:23]' # JSON-VERBOSE exemplars reads what we expect from ../transit-format/examples/0.8/simple/doubles_interesting.verbose.json
semaperepelitsa
Metadata
Metadata
Assignees
Labels
No labels