diff options
author | Francis Irving <francis@mysociety.org> | 2009-12-02 17:51:30 +0000 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2009-12-02 17:51:30 +0000 |
commit | 5f3139b538d1ff58b719a72d7c7cf05a5b6136b5 (patch) | |
tree | 13597cf6751df3122bfb1f1e5b1699e5c7ec5f93 /vendor/plugins/rspec/README.rdoc | |
parent | dcf788cab6268a5c9830178d1bdff606f84132ce (diff) |
Part of upgrade to rails 2.3.2
Diffstat (limited to 'vendor/plugins/rspec/README.rdoc')
-rw-r--r-- | vendor/plugins/rspec/README.rdoc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/vendor/plugins/rspec/README.rdoc b/vendor/plugins/rspec/README.rdoc new file mode 100644 index 000000000..3174497a3 --- /dev/null +++ b/vendor/plugins/rspec/README.rdoc @@ -0,0 +1,55 @@ += RSpec + +* http://rspec.info +* http://rubyforge.org/projects/rspec +* http://github.com/dchelimsky/rspec/wikis +* mailto:rspec-users@rubyforge.org +* mailto:rspec-devel@rubyforge.org + +== DESCRIPTION: + +RSpec is a Behaviour Driven Development framework for writing executable code +examples. + +== FEATURES: + +* Spec::Example provides a framework for organizing executable code examples +* Spec::Expectations adds #should and #should_not to every object +* Spec::Matchers provides Expression Matchers for use with #should and #should_not +* Spec::Mocks is a full featured mock object/stubbing library + +== SYNOPSIS: + + describe Account do + context "transfering money" do + it "deposits transfer amount to the other account" do + source = Account.new(50, :USD) + target = mock('target account') + target.should_receive(:deposit).with(Money.new(5, :USD)) + source.transfer(5, :USD).to(target) + end + + it "reduces its balance by the transfer amount" do + source = Account.new(50, :USD) + target = stub('target account') + source.transfer(5, :USD).to(target) + source.balance.should == Money.new(45, :USD) + end + end + end + + $ spec spec/account_spec.rb --format nested + Account + transfering money + deposits transfer amount to the other account + reduces its balance by the transfer amount + + 2 examples, 0 failures + +== INSTALL: + + [sudo] gem install rspec + + or + + clone, build, install - See http://wiki.github.com/dchelimsky/rspec
\ No newline at end of file |