hal-interpretation 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb105631be075dfd26ba7e8250c74e7ebe71b96
|
4
|
+
data.tar.gz: f64b9a1ad967f2ec3a27ad2870846af772e46c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc1bccb18281d451c008fa1abdb30ce7af07a872a279322d5ef15041ab9292bdb8f3b12d4bcb4c88b8c04aeb962df281d1509d2089e470186842942546211c4
|
7
|
+
data.tar.gz: e59db9dbf4107c7e9fecfd84ed9b7b77614ecd0afb521947087c0842ef21cf2801acd1ec0bdf90f5900dd64f6a8b7d8297b6d499685939af0956e38124551f8a
|
@@ -72,6 +72,24 @@ describe HalInterpretation::Extractor do
|
|
72
72
|
specify { expect(target.age).to eq 1 }
|
73
73
|
end
|
74
74
|
|
75
|
+
context "boolean attr true" do
|
76
|
+
subject(:extractor) { described_class.new(attr: "likes_chocolate",
|
77
|
+
location: "/likesChocolate") }
|
78
|
+
|
79
|
+
before do extractor.extract(from: source, to: target) end
|
80
|
+
|
81
|
+
specify { expect(target.likes_chocolate).to eq true }
|
82
|
+
end
|
83
|
+
|
84
|
+
context "boolean attr false" do
|
85
|
+
subject(:extractor) { described_class.new(attr: "likes_anchovies",
|
86
|
+
location: "/likesAnchovies") }
|
87
|
+
|
88
|
+
before do extractor.extract(from: source, to: target) end
|
89
|
+
|
90
|
+
specify { expect(target.likes_anchovies).to eq false }
|
91
|
+
end
|
92
|
+
|
75
93
|
context "missing attr" do
|
76
94
|
subject(:extractor) { described_class.new(attr: "seq") }
|
77
95
|
|
@@ -81,11 +99,20 @@ describe HalInterpretation::Extractor do
|
|
81
99
|
end
|
82
100
|
|
83
101
|
|
84
|
-
let(:target) { Struct.new(:first_name,
|
102
|
+
let(:target) { Struct.new(:first_name,
|
103
|
+
:bday,
|
104
|
+
:parent,
|
105
|
+
:seq,
|
106
|
+
:age,
|
107
|
+
:likes_chocolate,
|
108
|
+
:likes_anchovies).new }
|
109
|
+
|
85
110
|
let(:source) { HalClient::Representation.new(parsed_json: {
|
86
111
|
"age" => 1,
|
87
112
|
"firstName" => "Alice",
|
88
113
|
"bday" => "2013-10-10T12:13:14Z",
|
114
|
+
"likesChocolate" => true,
|
115
|
+
"likesAnchovies" => false,
|
89
116
|
"_links" => {
|
90
117
|
"up" => { "href" => "http://foo" }}}) }
|
91
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal-interpretation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hal-client
|