json encoding test is failing with ruby 2.0.0
pravi opened this issue · comments
Same test gets a pass when run with ruby 2.1
$ ruby2.0 --version
ruby 2.0.0p457 (2014-03-03) [x86_64-linux-gnu]
Running tests for ruby2.0 with test file list from debian/ruby-test-files.yaml ...
Run options: --seed 6152
Running:
..F.....
Finished in 0.107370s, 74.5087 runs/s, 74.5087 assertions/s.
- Failure:
TestJSONEncoding#test_encode_with_bad_input [/home/pravi/forge/debian/diaspora/ruby-fog-json-1.0.0/test/json_encode_test.rb:15]:
Fog::JSON::EncodeError expected but nothing was raised.
8 runs, 8 assertions, 1 failures, 0 errors, 0 skips
Test "ruby2.0" failed. Continue building the package? (Y/N) y
Running tests for ruby2.1 with test file list from debian/ruby-test-files.yaml ...
Run options: --seed 29850
Running:
........
Finished in 0.249668s, 32.0425 runs/s, 32.0425 assertions/s.
8 runs, 8 assertions, 0 failures, 0 errors, 0 skips
Yeah. Confirmed.
I setup Travis but didn't get anything building.
We need to require fog-core
for the error base class we test with so I'm pushing that and then this issue should be visible on Travis.
Haven't managed to get to the bottom of this. Now the testing is running there are failures for both 1.8.7 and 2.0.0
The ok_json
adapter does not fail on the sample input (which I took from the MultiJson specs) which I think covers the 1.8.7 tests. There is also an issue with 1.8.7 hashes order changing now popping so the generated String is not the same.
I'm going to try to setup a brand new 2.0.0 environment to confirm that the default adapter behaves as expected.
I'm mitigating the failures rather than "fixing" them since the failures are basically Ruby versions/JSON adapters mismatching so that the test strings are not triggering errors.
If someone can provide invalid JSON strings that actually choke Ruby 1.8.7 and 2.0.0 I may update the tests but it's not worth reimplementing the MultiJson specs.