Revision: 1074 http://trac.macosforge.org/projects/ruby/changeset/1074 Author: eloy.de.enige@gmail.com Date: 2009-03-22 17:49:09 -0700 (Sun, 22 Mar 2009) Log Message: ----------- Tagged a case example as critical. Only 2 failing tests after that. Modified Paths: -------------- MacRuby/branches/experimental/spec/frozen/language/case_spec.rb Modified: MacRuby/branches/experimental/spec/frozen/language/case_spec.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/language/case_spec.rb 2009-03-23 00:35:19 UTC (rev 1073) +++ MacRuby/branches/experimental/spec/frozen/language/case_spec.rb 2009-03-23 00:49:09 UTC (rev 1074) @@ -28,7 +28,7 @@ when "b" end.should == nil end - + it "evaluates the 'else'-body when no other expression matches" do case "c" when "a"; 'foo' @@ -36,7 +36,7 @@ else 'zzz' end.should == 'zzz' end - + it "returns nil when no expression matches and 'else'-body is empty" do case "c" when "a"; "a" @@ -89,7 +89,7 @@ "foo" end.should == "foo" end - + it "takes lists of values" do case 'z' when 'a', 'b', 'c', 'd' @@ -131,10 +131,11 @@ end.should == "foo" end + # MR: critical it "concats arrays before expanding them" do a = ['a', 'b', 'c', 'd'] b = ['f'] - + case 'f' when 'f', *a|b "foo" @@ -142,14 +143,14 @@ "bar" end.should == "foo" end - + it "never matches when clauses with no values" do case nil when *[] "foo" end.should == nil end - + it "lets you define a method after the case statement" do case (def foo; 'foo'; end; 'f') when 'a' @@ -158,7 +159,7 @@ 'bar' end.should == 'bar' end - + it "raises a SyntaxError when 'else' is used when no 'when' is given" do lambda { eval <<-CODE