statham 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statham/attribute.rb +2 -0
- data/lib/statham/version.rb +1 -1
- data/spec/unit/attribute_spec.rb +10 -0
- 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: 2ef2e0599773c326dc2fe71f37e2bc4bba172048
|
4
|
+
data.tar.gz: 7c86669164bae3c87918ba48659b63c0737c61c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 259d08ef343b95cefda82b7bb388379ecd87b25fa45b85eae03cea87135581f989f6cf5ca7faedda0e4231d0f6972279dbb38c370e20ed43844476098f0688b5
|
7
|
+
data.tar.gz: 42b49440d86b7614fd288ab5fcd2c9a867f621e0545a75bdefc63a6e64e7f0c5aaeb9f5f0ac0288b32f93c54e91a800171d3b26ddc2cdfcdcdfac11a09d5997a
|
data/lib/statham/attribute.rb
CHANGED
data/lib/statham/version.rb
CHANGED
data/spec/unit/attribute_spec.rb
CHANGED
@@ -21,6 +21,16 @@ describe Statham::Attribute do
|
|
21
21
|
it { expect { attribute.serialize([1, 2, 3]) }.not_to raise_error }
|
22
22
|
end
|
23
23
|
|
24
|
+
context 'when type is hash' do
|
25
|
+
let(:attribute) { Statham::Attribute.new(type: :hash) }
|
26
|
+
|
27
|
+
it { expect(attribute.serialize(nil)).to be_nil }
|
28
|
+
it { expect { attribute.serialize(true) }.to raise_error }
|
29
|
+
it { expect { attribute.serialize({ foo: :bar }) }.not_to raise_error }
|
30
|
+
it { expect { attribute.serialize('string') }.to raise_error }
|
31
|
+
it { expect { attribute.serialize([1, 2, 3]) }.to raise_error }
|
32
|
+
end
|
33
|
+
|
24
34
|
context 'when default value is set' do
|
25
35
|
let(:default) { 'hello' }
|
26
36
|
let(:value) { 'world' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statham
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inbeom Hwang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|