conglomerate 0.1.1 → 0.2.0
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 +4 -4
- data/lib/conglomerate/serializer.rb +1 -1
- data/lib/conglomerate/version.rb +1 -1
- data/spec/conglomerate_spec.rb +15 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ff3bd7063846051708c677ab9f8c3c0ebe0d5d
|
4
|
+
data.tar.gz: 24433fc68163aebbbf567868edc05e807a07cf88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bf22794559d3319db96ffe11989ef093eed2f3402dcc435c645220663dabbb140c980e9eb938163baa4ab0f0cf695bcf3c3d7dc019e9c562c95c9a98c5ae8f6
|
7
|
+
data.tar.gz: a82de2fe1c7dd8e60cf911b32eb914a07ba258508af060407d86e1372183a583240b192cd66cc6379a16edcaaef026085e335a783e4f0396fd858bebe50da651
|
@@ -189,7 +189,7 @@ module Conglomerate
|
|
189
189
|
attr_writer :_href, :_item_href, :_queries, :_attributes, :_links
|
190
190
|
|
191
191
|
def _href
|
192
|
-
@_href || Proc.new {
|
192
|
+
@_href || Proc.new { raise ArgumentError, "You must include an href" }
|
193
193
|
end
|
194
194
|
|
195
195
|
def _item_href
|
data/lib/conglomerate/version.rb
CHANGED
data/spec/conglomerate_spec.rb
CHANGED
@@ -34,11 +34,18 @@ end
|
|
34
34
|
class ConglomerateExtraTestSerializer
|
35
35
|
include Conglomerate.serializer
|
36
36
|
|
37
|
+
href { "" }
|
37
38
|
attribute :id
|
38
39
|
end
|
39
40
|
|
40
41
|
class ConglomerateNullSerializer
|
41
42
|
include Conglomerate.serializer
|
43
|
+
|
44
|
+
href { "" }
|
45
|
+
end
|
46
|
+
|
47
|
+
class ConglomerateInvalidSerializer
|
48
|
+
include Conglomerate.serializer
|
42
49
|
end
|
43
50
|
|
44
51
|
describe Conglomerate do
|
@@ -89,12 +96,18 @@ describe Conglomerate do
|
|
89
96
|
ConglomerateNullSerializer.new(object, :context => context).serialize
|
90
97
|
end
|
91
98
|
|
99
|
+
let(:invalid_serializer) do
|
100
|
+
ConglomerateInvalidSerializer.new(object, :context => context).serialize
|
101
|
+
end
|
102
|
+
|
92
103
|
let(:test_collection) { test_serializer["collection"] }
|
93
104
|
|
94
105
|
let(:extra_test_collection) { extra_test_serializer["collection"] }
|
95
106
|
|
96
107
|
let(:null_collection) { null_serializer["collection"] }
|
97
108
|
|
109
|
+
let(:invalid_collection) { invalid_serializer["collection"] }
|
110
|
+
|
98
111
|
describe "#version" do
|
99
112
|
it "sets version to 1.0" do
|
100
113
|
expect(null_collection["version"]).to eq("1.0")
|
@@ -107,8 +120,8 @@ describe Conglomerate do
|
|
107
120
|
expect(test_collection["href"]).to eq("abc")
|
108
121
|
end
|
109
122
|
|
110
|
-
it "
|
111
|
-
expect
|
123
|
+
it "errors if no href given" do
|
124
|
+
expect { invalid_collection["href"] }.to raise_error
|
112
125
|
end
|
113
126
|
end
|
114
127
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conglomerate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Emmons
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|