doc/src/tutorials/stack_06.page in rspec-0.5.6 vs doc/src/tutorials/stack_06.page in rspec-0.5.7
- old
+ new
@@ -8,19 +8,19 @@
setup do
@stack = Stack.new
end
specify "should keep its mouth shut when you send it 'push'" do
- lambda { @stack.push Object.new }.should.not.raise Exception
+ lambda { @stack.push Object.new }.should_not.raise Exception
end
specify "should raise a StackUnderflowError when you send it 'top'" do
- lambda { @stack.top }.should.raise StackUnderflowError
+ lambda { @stack.top }.should_raise StackUnderflowError
end
specify "should raise a StackUnderflowError when you send it 'pop'" do
- lambda { @stack.pop }.should.raise StackUnderflowError
+ lambda { @stack.pop }.should_raise StackUnderflowError
end
end
</ruby>
@@ -119,19 +119,19 @@
@stack = Stack.new
@stack.push "one item"
end
specify "should keep its mouth shut when you send it 'push'" do
- lambda { @stack.push Object.new }.should.not.raise Exception
+ lambda { @stack.push Object.new }.should_not.raise Exception
end
specify "should return top when you send it 'top'" do
- @stack.top.should.equal "one item"
+ @stack.top.should_equal "one item"
end
specify "should return top when you send it 'pop'" do
- @stack.pop.should.equal "one item"
+ @stack.pop.should_equal "one item"
end
end
</ruby>
@@ -234,10 +234,10 @@
What we're looking for here is observable behaviour. How does a one-element stack behave after we send it 'pop'. We've stated that the stack should be empty at that point, right? So perhaps the observable behaviour is that it acts like an empty stack:
<ruby>
specify "should raise a StackUnderflowError the second time you sent it 'pop'" do
@stack.pop
- lambda { @stack.pop }.should.raise StackUnderflowError
+ lambda { @stack.pop }.should_raise StackUnderflowError
end
</ruby>
Run the specs (this time without the -v flag)...
\ No newline at end of file