spec/option_spec.rb in option-0.5.0 vs spec/option_spec.rb in option-0.6.0
- old
+ new
@@ -72,10 +72,14 @@
end
it "#or_else should raise a TypeError if an Option is not returned" do
lambda { None.or_else { value } }.must_raise TypeError
end
+
+ it "#flatten should return itself" do
+ None.flatten.must_be_none
+ end
end
describe SomeClass do
it "#to_a returns the value wrapped in an array" do
@@ -162,9 +166,13 @@
Some(value).must_be_instance_of(SomeClass)
end
it "should be aliased to Some" do
Some.new(value).must_be_some(value)
+ end
+
+ it "#flatten" do
+ Some(Some(Some(value))).flatten.must_be_some(value)
end
end
describe OptionClass do