tests/symbol.fy in fancy-0.3.3 vs tests/symbol.fy in fancy-0.4.0

- old
+ new

@@ -1,17 +1,30 @@ FancySpec describe: Symbol with: { - it: "should be usable like a block for Enumerable methods" when: { + it: "is usable like a block for Enumerable methods" with: 'call: when: { [1,2,3,4,5] map: 'squared . - should == [1,4,9,16,25] + is: [1,4,9,16,25] ["hello", "world"] map: 'upcase . - should == ["HELLO", "WORLD"] + is: ["HELLO", "WORLD"] [1,2,3,4,5] select: 'even? . - should == [2,4] + is: [2,4] } - it: "should evaluate itself within the current scope" when: { + it: "evaluates itself within the current scope" with: 'eval when: { x = 10 - 'x eval should == x + 'x eval is: x + } + + it: "sends itself to the sender in its context" with: 'call when: { + def foo { + "foo" + } + def bar { + "bar" + } + x = false + if: x then: 'foo else: 'bar . is: "bar" + x = true + if: x then: 'foo else: 'bar . is: "foo" } }