spec/patternmatching_spec.rb in patternmatching-0.1.4 vs spec/patternmatching_spec.rb in patternmatching-0.2.0
- old
+ new
@@ -46,21 +46,28 @@
class PartialStyleDefs
def initialize
@name = "Foo"
end
attr :name
-
+ def foo
+ self
+ end
+
def bar
make "bar" do
seems as {:val} do
- @name = val
+ foo
+ the.name = val
+ this
end
end
end
func(:buzz).seems as {:val} do
- @name = val
+ foo
+ the.name = val
+ this
end
end
def calc(code)
@@ -181,11 +188,11 @@
end
it "should update fields from block" do
o = PartialStyleDefs.new
o.name.should == "Foo"
- o.bar
+ o.bar.should == o
o.name.should == "bar"
- o.buzz("buzz")
+ o.buzz("buzz").should == o
o.name.should == "buzz"
end
end