Permalink
Browse files

Add test to verify that stub block gets evaluated in the correct context

  • Loading branch information...
1 parent a020793 commit 1d6be5badb95753af17b74ed1acc4e4f1e7df912 Nikolai Weibull committed Jul 31, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/unit/lookout/expect/object/context.rb
@@ -9,6 +9,10 @@
Lookout::Expect::Object::Context.new{ stub(o, :a => 1){ |e| e } }.evaluate
end
+ expect Object.new do |o|
+ Lookout::Expect::Object::Context.new{ stub(o, :a => 1){ |e| stub(e, :b => 2){ |f| f } } }.evaluate
+ end
+
expect 1 do
Lookout::Expect::Object::Context.new{ stub(Object.new, :a => 1){ |o| o.a } }.evaluate
end

0 comments on commit 1d6be5b

Please sign in to comment.