totally_lazy 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/functions.rb +1 -1
- data/spec/option_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzFhMzBlOTFkNmRhZGEyMmVkNzA0ZGI5ODVjMWMzNDk3YjM2M2MyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTlkNWY5NTQ1N2I3YjZjMmUyMzQ5ZTQxZjhjNGIzNzdjNmUxYjIxMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzJlODdlZjc0MDZjNmZkZDA4MWRkMGJkOTUwZjcwOTU1NzlmMWM3YmI1YjIx
|
10
|
+
NDY2OTIyOGYyNmQ1YjQ1Y2RlOTYxYTA3MTY1Nzg1YTI5OWVkOWQwZGIzMGRm
|
11
|
+
MmU1NDk5NWYxODdjMDJmOGUzNjAwYjkxMTMwNDNiMjQyMmE4YjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTg2YWE1NDYyMWM4MWQyYWUwZmVjYTVjYjVjMzgyYzdkZDM0ODIxZTU1MTc4
|
14
|
+
NjNkYWVhY2RhNTY0NGJkMTI4ZTA4MzllY2Y3ZGQ1MzEyOWNiMjBiOGEwNDYy
|
15
|
+
MDNjNjU2ZmY4NmM1NGQ0ZjZmODAxMmIxMGNkYzQwMjVkNWJiYTc=
|
data/lib/functions.rb
CHANGED
data/spec/option_spec.rb
CHANGED
@@ -45,9 +45,9 @@ describe 'Option' do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'should support flat_map' do
|
48
|
-
expect(some(4).flat_map(divide(2).
|
49
|
-
expect(some(4).flat_map{ |v| divide(2).
|
50
|
-
expect(some(4).flat_map(divide(0).
|
48
|
+
expect(some(4).flat_map(divide(2).optional)).to eq(some(2))
|
49
|
+
expect(some(4).flat_map{ |v| divide(2).optional.(v) }).to eq(some(2))
|
50
|
+
expect(some(4).flat_map(divide(0).optional)).to eq(none)
|
51
51
|
expect(none.flat_map(constant(none))).to eq(none)
|
52
52
|
expect(none.flat_map(some(4))).to eq(none)
|
53
53
|
end
|
@@ -63,7 +63,7 @@ describe 'Option' do
|
|
63
63
|
expect { none.fold_left(0, ->(a, b) { a+b }) { |a, b| a+b } }.to raise_error(RuntimeError)
|
64
64
|
expect { some(1).map(->(v) { v.to_s }) { |v| v.to_s } }.to raise_error(RuntimeError)
|
65
65
|
expect { none.map(->(v) { v.to_s }) { |v| v.to_s } }.to raise_error(RuntimeError)
|
66
|
-
expect { some(4).flat_map(divide(2).
|
66
|
+
expect { some(4).flat_map(divide(2).optional){ |v| divide(2).optional.(v) } }.to raise_error(RuntimeError)
|
67
67
|
end
|
68
68
|
|
69
69
|
end
|