RSpec Results

 

 

Mocker
should be able to call mock()
should fail when expected message not received
should fail when messages are received out of order
should get yelled at when sending unexpected messages
has a bug we need to fix
Running specs with --diff
should print diff of different strings
expected: "RSpec is a\nbehaviour driven development\nframework for Ruby\n",
     got: "RSpec is a\nbehavior driven development\nframework for Ruby\n" (using ==)
Diff:
@@ -1,4 +1,4 @@
 RSpec is a
-behaviour driven development
+behavior driven development
 framework for Ruby
11framework for Ruby
12EOF
13    usa.should == uk
14  end
should print diff of different objects' pretty representation
expected <Animal
name=bob,
species=tortoise
>
, got <Animal
name=bob,
species=giraffe
>
 (using .eql?)
Diff:
@@ -1,5 +1,5 @@
 <Animal
 name=bob,
-species=tortoise
+species=giraffe
 >
32    expected = Animal.new "bob", "giraffe"
33    actual   = Animal.new "bob", "tortoise"
34    expected.should eql(actual)
35  end
36end
A consumer of a stub
should be able to stub methods on any Object
A stubbed method on a class
should return the stubbed value
should revert to the original method after each spec
can stub! and mock the same message
A mock
can stub!
can stub! and mock
can stub! and mock the same message
pending example (using pending method)
should be reported as "PENDING: for some reason" (PENDING: for some reason)
pending example (with no block)
should be reported as "PENDING: Not Yet Implemented" (PENDING: Not Yet Implemented)
pending example (with block for pending)
should have a failing block, passed to pending, reported as "PENDING: for some reason" (PENDING: for some reason)