Permalink
Browse files

Add test for yielding arbitary values

  • Loading branch information...
1 parent 2720ed3 commit 046eba1bea39239b9a46e5b44be978f4d73af268 @mbklein mbklein committed Nov 12, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 spec/confstruct/hash_with_struct_access_spec.rb
@@ -132,6 +132,19 @@
@hwsa.github.should == { :url => 'http://www.github.com/somefork/other-project', :branch => 'pre-1.0' }
end
+ it "should eval_or_yield all types" do
+ @hwsa.github do
+ items([]) do
+ self.should == []
+ push 1
+ push 'two'
+ push :III
+ self.should == [1,'two',:III]
+ end
+ end
+ @hwsa.github.items.should == [1,'two',:III]
+ end
+
it "should fail on other method signatures" do
lambda { @hwsa.error(1, 2, 3) }.should raise_error(NoMethodError)
end

0 comments on commit 046eba1

Please sign in to comment.