emery 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/emery/jsoner.rb +1 -1
- data/test/jsoner_test.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26f2aead0af20ab4b3b2e2a131f4fa177d416d94479f60a1c471e8971dcd2635
|
4
|
+
data.tar.gz: 19d9f6d0cb96aff5b25fe7ca2aeb85db3996fd4e74d8918add3b037fbf27a5c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c09640543db95471da8ea42578c6fa36732baad6061af415373822f45fdc62fb55c65edddafad4cc7f61f26d7d4d1a277ac5549428b7062fdc96062b4c0a8b
|
7
|
+
data.tar.gz: bcbd606c0041721f4ec4df3e81bff0c881721b8ac52272109e84fa06026c9ea0890b4ff920dfced918a379957c1846eade1855764e43e952dfa9ba2d18d26785
|
data/lib/emery/jsoner.rb
CHANGED
@@ -72,7 +72,7 @@ module Jsoner
|
|
72
72
|
types.each do |type|
|
73
73
|
begin
|
74
74
|
return Jsoner.deserialize(type, json_value)
|
75
|
-
rescue
|
75
|
+
rescue JsonerError
|
76
76
|
end
|
77
77
|
end
|
78
78
|
raise JsonerError.new("Value '#{json_value.inspect.to_s}' can not be deserialized as any of #{@types.map { |t| t.to_s}.join(', ')}")
|
data/test/jsoner_test.rb
CHANGED
@@ -33,10 +33,16 @@ class PlainTypesDeserialization < Test::Unit::TestCase
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
36
|
+
def test_deserialize_true
|
37
37
|
data = Jsoner.from_json(Boolean, 'true')
|
38
38
|
T.check(Boolean, data)
|
39
|
-
assert_equal true, data, "Boolean should be parsable from JSON"
|
39
|
+
assert_equal true, data, "Boolean true should be parsable from JSON"
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_deserialize_false
|
43
|
+
data = Jsoner.from_json(Boolean, 'false')
|
44
|
+
T.check(Boolean, data)
|
45
|
+
assert_equal false, data, "Boolean false should be parsable from JSON"
|
40
46
|
end
|
41
47
|
|
42
48
|
def test_deserialize_boolean_fail
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Sapronov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|