Permalink
Browse files

words

  • Loading branch information...
1 parent 5092fd3 commit f26af00fd0e1775542bc4fab0d906e88a26a17ad @dchelimsky dchelimsky committed Jul 7, 2010
Showing with 30 additions and 9 deletions.
  1. +30 −9 README.markdown
View
@@ -3,22 +3,43 @@
rspec-mocks provides a test-double framework for rspec including support
for method stubs, fakes, and message expectations.
-rspec-mocks is currently in alpha release. While you are welcome to
-track, fork, explore, etc, we're too early in the process to start fielding
-pull requests and or issues from outside the core development team, so please
-don't waste your time until this notice changes.
-
## Install
- [sudo] gem install rspec --prerelease
+ gem install rspec --prerelease
This will install rspec, rspec-core, rspec-expectations and rspec-mocks.
+## Method Stubs
+
+ describe "consumer" do
+ it "gets stuff from a service" do
+ service = double('service')
+ service.stub(:find) { 'value' }
+ consumer = Consumer.new(service)
+ consumer.consume
+ consumer.aquired_stuff.should eq(['value'])
+ end
+ end
+
+## Message Expectations
+
+ describe "some action" do
+ context "when bad stuff happens" do
+ it "logs the error" do
+ logger = double('logger')
+ doer = Doer.new(logger)
+ logger.should_receive(:log).with('oops')
+ doer.do_something_with(:bad_data)
+ end
+ end
+ end
-#### Also see
+## Contribute
+
+See [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev)
+
+## Also see
* [http://github.com/rspec/rspec](http://github.com/rspec/rspec)
* [http://github.com/rspec/rspec-core](http://github.com/rspec/rspec-core)
* [http://github.com/rspec/rspec-expectations](http://github.com/rspec/rspec-expectations)
-* [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev)
-

0 comments on commit f26af00

Please sign in to comment.