Mocker
should be able to call mock()
should fail when expected message not received
Mock 'poke me' expected :poke with (any args) once, but received it 0 times
./failing_examples/mocking_example.rb:13:
./spec/spec/runner/formatter/html_formatter_spec.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:36:
./spec/spec/runner/formatter/html_formatter_spec.rb:37:
should fail when messages are received out of order
Mock 'one two three' received :three out of order
./failing_examples/mocking_example.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:36:
./spec/spec/runner/formatter/html_formatter_spec.rb:37:
should get yelled at when sending unexpected messages
Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once
./failing_examples/mocking_example.rb:28:
./spec/spec/runner/formatter/html_formatter_spec.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:36:
./spec/spec/runner/formatter/html_formatter_spec.rb:37:
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
-behavior driven development
+behaviour driven development
 framework for Ruby
./failing_examples/diffing_spec.rb:13:
./spec/spec/runner/formatter/html_formatter_spec.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:36:
./spec/spec/runner/formatter/html_formatter_spec.rb:37:
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=giraffe
+species=tortoise
 >
./failing_examples/diffing_spec.rb:34:
./spec/spec/runner/formatter/html_formatter_spec.rb:22:
./spec/spec/runner/formatter/html_formatter_spec.rb:36:
./spec/spec/runner/formatter/html_formatter_spec.rb:37:
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