abstractivator 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/abstractivator/enum.rb +8 -0
- data/lib/abstractivator/version.rb +1 -1
- data/spec/lib/abstractivator/enum_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e21da1a080a716ba7807d66781ef4c0cb8bcee6a
|
4
|
+
data.tar.gz: 77814c5cff83133dac82c76758e568bc6d1055a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ae1ba1cbd05b247c480256cb132d8f2e50784e42355cb3fb2802f06e1c7f25f36d6d8e11d839079a322460edde3ed6368df3f44c186efb4f3d915097792b59
|
7
|
+
data.tar.gz: 751e1e23feda00161a008f5674fefd3ace2ee128647fb9bf7523097d2bf2e8fa67fdba899e8bc2f8137634b0cbc9217b4ea756c22016b135026ca79d152f3429
|
data/lib/abstractivator/enum.rb
CHANGED
@@ -50,6 +50,20 @@ describe Enum do
|
|
50
50
|
expect{Container::Fruits.new('durian')}.to raise_error NoMethodError
|
51
51
|
end
|
52
52
|
end
|
53
|
+
describe '#as_json' do
|
54
|
+
it "as_json's the value" do
|
55
|
+
hash = double
|
56
|
+
expect(Meats::BACON.value).to receive(:as_json).and_return(hash)
|
57
|
+
expect(Meats::BACON.as_json).to eql hash
|
58
|
+
end
|
59
|
+
end
|
60
|
+
describe '#to_json' do
|
61
|
+
it "to_json's the value" do
|
62
|
+
json = double
|
63
|
+
expect(Meats::BACON.value).to receive(:to_json).and_return(json)
|
64
|
+
expect(Meats::BACON.to_json).to eql json
|
65
|
+
end
|
66
|
+
end
|
53
67
|
end
|
54
68
|
|
55
69
|
describe '#define_enum' do
|