or_else 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/or_else/just.rb +4 -0
- data/lib/or_else/nothing_class.rb +4 -0
- data/lib/or_else/version.rb +1 -1
- data/spec/or_else/just_spec.rb +18 -0
- data/spec/or_else/nothing_spec.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 620ca7c95c1fbc42f56933bf0c4e1d9955705eb4
|
4
|
+
data.tar.gz: 8b1338aed7d6ee2b83f17f55723a953abaa95b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f902c20e8e58708e7374cd64c448c22185cf0c7be0b13d711ab83006ec926c8fe6b89dc963faa718783cac17fd159ca711aaceddf7aa1b3671940780d2f6bcbc
|
7
|
+
data.tar.gz: a596e624abf88bccde7228e2cad3ce421a4130d360ec879db975f3192f29e7e84e07e8a0a1dd4f428828bec99c395ab8234f3d870b6e5c767a1e827f01b51c2a
|
data/lib/or_else/just.rb
CHANGED
data/lib/or_else/version.rb
CHANGED
data/spec/or_else/just_spec.rb
CHANGED
@@ -60,6 +60,24 @@ module OrElse
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
describe '#filter' do
|
64
|
+
let(:val) { 1 }
|
65
|
+
|
66
|
+
specify { expect { |b| just.filter(&b) }.to yield_with_args(val) }
|
67
|
+
|
68
|
+
context 'when the predicate returns true' do
|
69
|
+
it 'returns the Just intact' do
|
70
|
+
expect(just.filter {|j| j == 1}).to eq just
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'when the predicate returns false' do
|
75
|
+
it 'returns Nothing' do
|
76
|
+
expect(just.filter {|j| j != 1}).to eq Nothing
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
63
81
|
describe '#empty?' do
|
64
82
|
let(:val) { 1 }
|
65
83
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: or_else
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alexpeachey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.4.5
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: A simple Maybe/Option implementation.
|