poms 1.2.1 → 1.2.2
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/Gemfile.lock +1 -1
- data/lib/poms/fields.rb +3 -1
- data/lib/poms/version.rb +1 -1
- data/spec/lib/poms/fields_spec.rb +9 -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: 2cf1cb8d138dfb0cc64941c91166579039374f9f
|
4
|
+
data.tar.gz: 211325fcdf33276731f6955fff221311b3678e50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 943723499c03b7dfa58465c365d07787aede3b30d710332bbc6c046fce03f6050ece00da032c9416c41e09383668e69bf0ff9ea9c5b5be6bcae153765b75aab7
|
7
|
+
data.tar.gz: e73de97e4ef76cfd6db078e671d2ced5c4582e5021ec5132041e76fdee3246d86625a72fe83981c5174079fd9509eaf46f17becc12b706c04f634256833fa44d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/poms/fields.rb
CHANGED
@@ -72,7 +72,9 @@ module Poms
|
|
72
72
|
# @param key The key of the array we want to look in
|
73
73
|
# @param type The type to select
|
74
74
|
def value_of_type(item, key, type)
|
75
|
-
item[key].find { |value| value['type'] == type }
|
75
|
+
res = item[key].find { |value| value['type'] == type }
|
76
|
+
return unless res
|
77
|
+
res['value']
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
data/lib/poms/version.rb
CHANGED
@@ -7,6 +7,10 @@ describe Poms::Fields do
|
|
7
7
|
it 'returns the first MAIN title' do
|
8
8
|
expect(described_class.title(poms_data)).to eq('VRijland')
|
9
9
|
end
|
10
|
+
|
11
|
+
it 'returns nil if no title can be found' do
|
12
|
+
expect(described_class.title(poms_data, 'NONEXISTANTTYPE')).to be_nil
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
16
|
describe '#description' do
|
@@ -16,6 +20,11 @@ een baantje aan bij de uitdragerij en vraagt zich meteen af of dat wel zo slim \
|
|
16
20
|
was. Timon en Joep zien de criminele organisatie de Rijland Angels. Timon wil \
|
17
21
|
naar hun loods, maar is dat wel een goed idee?")
|
18
22
|
end
|
23
|
+
|
24
|
+
it 'returns nil if no description can be found' do
|
25
|
+
expect(described_class.description(poms_data, 'NONEXISTANTTYPE'))
|
26
|
+
.to be_nil
|
27
|
+
end
|
19
28
|
end
|
20
29
|
|
21
30
|
describe '#first_image_id' do
|