Permalink
Browse files

Remove #name method from Nothing

  • Loading branch information...
1 parent c41ae71 commit 6d8d9416f769fd7282ca168ee730244ddc05e86a @pzol committed May 29, 2012
Showing with 11 additions and 1 deletion.
  1. +3 −0 CHANGELOG.md
  2. +2 −0 lib/monadic/maybe.rb
  3. +1 −1 lib/monadic/version.rb
  4. +5 −0 spec/maybe_spec.rb
View
3 CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
+## v0.2.1
+Nothing has no method #name ... will need to use `BasicObject`
+
## v0.2.0
**BREAKING CHANGES**
View
2 lib/monadic/maybe.rb
@@ -46,6 +46,8 @@ def method_missing(m, *args)
# Represents a NullObject
class Nothing < Maybe
class << self
+ undef name
+
def fetch(default=nil)
return self if default.nil?
return default
View
2 lib/monadic/version.rb
@@ -1,3 +1,3 @@
module Monadic
- VERSION = "0.2.0"
+ VERSION = "0.2.1"
end
View
5 spec/maybe_spec.rb
@@ -47,6 +47,11 @@
Nothing.empty?.should be_true
Nothing.truly?.should be_false
end
+
+ it 'returns Nothing when calling #name' do
+ hd = Nothing
+ hd.name.should == Monadic::Nothing
+ end
end
describe Monadic::Just do

0 comments on commit 6d8d941

Please sign in to comment.