test/either_test.rb in rumonade-0.2.1 vs test/either_test.rb in rumonade-0.2.2
- old
+ new
@@ -157,6 +157,11 @@
assert_equal "Left(error)", Left("error").to_s
assert_equal "Right(42)", Right(42).to_s
assert_equal "RightProjection(Left(error))", Left("error").right.to_s
assert_equal "LeftProjection(Right(42))", Right(42).left.to_s
end
+
+ def test_plus_for_left_and_right
+ assert_equal Left(["bad", "worse"]), Left("bad") + Right(:good) + Left("worse") + Right(:good)
+ assert_equal Right([:good, :better]), Right(:good) + Right(:better)
+ end
end