maybelline 1.0.0 → 1.0.1
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/lib/maybelline/version.rb +1 -1
- data/lib/maybelline.rb +2 -0
- data/spec/maybelline_spec.rb +10 -0
- metadata +3 -3
data/lib/maybelline/version.rb
CHANGED
data/lib/maybelline.rb
CHANGED
data/spec/maybelline_spec.rb
CHANGED
@@ -18,6 +18,10 @@ describe Maybelline::Maybe do
|
|
18
18
|
expect{subject.i_wanna_nil}.to throw_symbol
|
19
19
|
end
|
20
20
|
|
21
|
+
it "should thow :nothing if initialized with nil" do
|
22
|
+
expect{Maybelline::Maybe.new(nil)}.to throw_symbol
|
23
|
+
end
|
24
|
+
|
21
25
|
it "should expose the internal object with __object__" do
|
22
26
|
subject.__object__.should == object
|
23
27
|
end
|
@@ -40,6 +44,12 @@ describe "#Maybe" do
|
|
40
44
|
result = Maybe(object){|o| o.rob.bob.jack}
|
41
45
|
result.should == 1
|
42
46
|
end
|
47
|
+
|
48
|
+
it "should not call the block when called when nil is passed" do
|
49
|
+
executed = false
|
50
|
+
Maybe(nil){executed = true}
|
51
|
+
executed.should be_false
|
52
|
+
end
|
43
53
|
end
|
44
54
|
|
45
55
|
describe "#maybe" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maybelline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-06-23 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70102062050120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70102062050120
|
25
25
|
description: Maybe you should start using the maybe monad, stop checking for nil,
|
26
26
|
and be confident
|
27
27
|
email:
|