totally_lazy 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/option.rb +4 -0
- data/spec/option_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjVkZmRmNmMyNzlkYmY4ODlhYjhlMzFlN2FlMDQ0ZjIyOWE3M2ZiNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWI2NWQzMmFiODVjZjg1ZGI0NGQzN2JhNmY4MWU5MWQ3Y2NkYjdjYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGI4MzBiOTlmZWEyYjgzZTBhODgwYTMyNzFjMTJiMzQyY2M2ZmJmNDFhNGI0
|
10
|
+
ODAyYzIyMjhkMjRmNTBjZmY0N2IyNWRlYTFjM2M3NDhmODkwN2IyMDI2NDJm
|
11
|
+
YmE5NWM4MDdkNzY5NGE4YTNlYTI5ZDUwNTE3Mjg3ZTgwYzQ1NGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTQwNmZhZTRhZTliOTRmZjJkMjkxNTE4ZjQ5NGVjNWZlMzFiYTcyZWUxYzg5
|
14
|
+
OWM1MTM5NTkxMTk0NjUwNWE1YThiOWY1OTI2OWRiNjQ3YzA3MTRkN2JhMzZi
|
15
|
+
NzkyM2RkYTcyYmE2MWJiY2U2Njc4NjJjZWExNWZjMjM0MzcyYzQ=
|
data/lib/option.rb
CHANGED
data/spec/option_spec.rb
CHANGED
@@ -52,6 +52,11 @@ describe 'Option' do
|
|
52
52
|
expect(none.flat_map(some(4))).to eq(none)
|
53
53
|
end
|
54
54
|
|
55
|
+
it 'should support flatten' do
|
56
|
+
expect(some(some(1)).flatten).to eq(some(1))
|
57
|
+
expect(some(none).flatten).to eq(none)
|
58
|
+
end
|
59
|
+
|
55
60
|
it 'should raise exception if you try to use both lambda and block' do
|
56
61
|
expect { some(1).exists?(->(a) { a == 1 }) { |b| b == 2 } }.to raise_error(RuntimeError)
|
57
62
|
expect { none.exists?(->(a) { a == 1 }) { |b| b == 2 } }.to raise_error(RuntimeError)
|