optional 0.0.5 → 0.0.6
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.
- data/Gemfile.lock +1 -1
- data/lib/optional/some.rb +1 -1
- data/optional.gemspec +1 -1
- data/spec/lib/optional/option/enumerable_spec.rb +4 -4
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/lib/optional/some.rb
CHANGED
data/optional.gemspec
CHANGED
@@ -7,14 +7,14 @@ describe Option::Enumerable do
|
|
7
7
|
|
8
8
|
describe "#map_through" do
|
9
9
|
it "allows mapping through multiple methods" do
|
10
|
-
Some[cat
|
10
|
+
Some[cat].map_through(:name, :chars, :first).should eq Some["M"]
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "#map" do
|
15
15
|
|
16
16
|
it "maps a some to a some" do
|
17
|
-
Some[cat
|
17
|
+
Some[cat].map(&:name).should eq Some["MOGGIE!"]
|
18
18
|
end
|
19
19
|
|
20
20
|
it "also works for collect" do
|
@@ -60,7 +60,7 @@ describe Option::Enumerable do
|
|
60
60
|
|
61
61
|
Some[cat].juxt(:name, :class).should eq Some["MOGGIE!", Cat]
|
62
62
|
|
63
|
-
Some[1
|
63
|
+
Some[1].juxt(:pred, :succ).should eq Some[0, 2]
|
64
64
|
end
|
65
65
|
|
66
66
|
it "also works for nil" do
|
@@ -143,7 +143,7 @@ describe Option::Enumerable do
|
|
143
143
|
end
|
144
144
|
|
145
145
|
it "also works within the some" do
|
146
|
-
Some[3,4,5].reduce(:+).should eq
|
146
|
+
Some[3,4,5].reduce(:+).should eq [3,4,5]
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|