1 require File.join(File.dirname(__FILE__), %w(.. init))
4 specify "one or more nils results in nil" do
12 maybe.value.should == nil
15 specify "all non-nil results in complete calculation" do
23 maybe.value.should == 3
28 specify "all results are calculated and concatenated" do
36 array.should == [11, 21, 31, 12, 22, 32, 13, 23, 33]
40 describe "Monad.run" do
41 specify "should pass extra arguments into the block" do
44 array = Array.run(foo) do |foo|
51 array.should == [8011, 8021, 8031, 8012, 8022, 8032, 8013, 8023, 8033]
56 array = Array.run(foo, bar) do |foo, bar|
63 array.should == [78011, 78021, 78031, 78012, 78022, 78032, 78013, 78023, 78033]
66 specify "should be nestable" do
85 array.should == ["ABCD", "ABCd", "ABcD", "ABcd",
86 "AbCD", "AbCd", "AbcD", "Abcd",
87 "aBCD", "aBCd", "aBcD", "aBcd",
88 "abCD", "abCd", "abcD", "abcd"]