Zundra Daniel wrote:
> I'd actually like to know the answer to that one.  What is the reason 
> for
> enclosing the rspec test case in a lamda?  Is it because you don't want 
> the
> exception actually raised in the test case but raised in another context
> then observed?

Well, for one thing, it's just the way the RSpec API works.  But it 
makes sense: with lambda, the expression tested can be an arbitrary 
block, not just a single statement:

lambda do
  car = Car.new :make => "Toyota", :color => :blue
  car.options.add PowerSteeringUnit.new
  car.drive
  car.park
  car.lock
end.should_not raise_error

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen / marnen.org
-- 
Posted via http://www.ruby-forum.com/.