burgundy 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/burgundy/item.rb +4 -0
- data/lib/burgundy/version.rb +1 -1
- data/test/unit/burgundy_test.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0135de677253ae6ac1eb432a531a2ad03d9ea7e01d2f5cfecff1af7b3c86a262
|
4
|
+
data.tar.gz: 6d3aef1c8210b1ddcd9f3e4ad48c0531145fa71d7b4b7b8948e51a6b3fa6fd4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 990a2fd0d9501979d3d02149d548885ddf37933258fd671f59b98bef918ab6043e359bebb263657c6076cd757fcf7e186641a4f4d48c6d3ec5463a31561ba240
|
7
|
+
data.tar.gz: b7b93b21c5b354ca7f9bc6befae0b5e8701c1aa997df31fd2f2317d3114aadfb009e809920bb7dd1b8ae1c58496ec6ce12b97ff40a684540fdebb68bf97acbf2
|
data/CHANGELOG.md
CHANGED
data/lib/burgundy/item.rb
CHANGED
data/lib/burgundy/version.rb
CHANGED
data/test/unit/burgundy_test.rb
CHANGED
@@ -189,6 +189,21 @@ class BurgundyTest < Minitest::Test
|
|
189
189
|
assert_equal item.as_json(:name), item.attributes
|
190
190
|
end
|
191
191
|
|
192
|
+
test "implements to_json protocol" do
|
193
|
+
wrapper = Class.new(Burgundy::Item) do
|
194
|
+
attributes :name
|
195
|
+
end
|
196
|
+
|
197
|
+
object = OpenStruct.new(
|
198
|
+
name: "John Doe",
|
199
|
+
email: "john@example.com",
|
200
|
+
username: "johndoe"
|
201
|
+
)
|
202
|
+
item = wrapper.new(object)
|
203
|
+
|
204
|
+
assert_equal %[{"name":"John Doe"}], item.to_json
|
205
|
+
end
|
206
|
+
|
192
207
|
test "inherits attributes" do
|
193
208
|
parent_wrapper = Class.new(Burgundy::Item) do
|
194
209
|
attributes :name, :username
|