Permalink
Browse files

rdoc cleanup

  • Loading branch information...
1 parent d28f103 commit f71c08475c94a1954f6fb93284bbd45894626632 @dchelimsky committed Dec 16, 2008
Showing with 40 additions and 38 deletions.
  1. +24 −24 README.txt
  2. +16 −14 lib/spec/example.rb
View
@@ -1,14 +1,14 @@
= RSpec
* http://rspec.info
-* http://rspec.info/rdoc/
* http://rubyforge.org/projects/rspec
* http://github.com/dchelimsky/rspec/wikis
* mailto:rspec-devel@rubyforge.org
== DESCRIPTION:
-RSpec is a Behaviour Driven Development framework with tools to express executable code examples.
+RSpec is a Behaviour Driven Development framework for writing executable code
+examples.
== FEATURES:
@@ -19,31 +19,31 @@ RSpec is a Behaviour Driven Development framework with tools to express executab
== 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)
+ 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
-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
+
+ $ 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
+ 2 examples, 0 failures
== INSTALL:
View
@@ -1,5 +1,5 @@
module Spec
- # == ExampleGroups and Code Examples
+ # == Example Groups and Code Examples
#
# A Code Example is an executable example of how a bit of code is expected
# to behave.
@@ -17,9 +17,10 @@ module Spec
#
# == Before and After
#
- # You can use before() and after() to extract common code within an Example
- # Group. Both methods take an optional scope argument so you can run the
- # block before :each example or before :all examples
+ # You can use the <tt>before()</tt> and <tt>after()</tt> methods to extract
+ # common code within an Example Group. Both methods take an optional scope
+ # argument so you can run the block before :each example or before :all
+ # examples
#
# describe "..." do
# before :all do
@@ -53,16 +54,16 @@ module Spec
# each of the examples.
#
# It is also possible to specify a <tt>before :all</tt> and <tt>after
- # :all</tt> block that will run only once for each behaviour, respectively
- # before the first <code>before :each</code> and after the last <code>after
- # :each</code>. The use of these is generally discouraged, because it
- # introduces dependencies between the examples. Still, it might prove useful
- # for very expensive operations if you know what you are doing.
+ # :all</tt> block that will run only once for each example group, before the
+ # first <code>before :each</code> and after the last <code>after
+ # :each</code> respectively. The use of these is generally discouraged,
+ # because it introduces dependencies between the examples. Still, it might
+ # prove useful for very expensive operations if you know what you are doing.
#
# == Local helper methods
#
- # You can include local helper methods by simply expressing them within a
- # context:
+ # You can include local helper methods by simply expressing them within an
+ # example group:
#
# describe "..." do
#
@@ -78,8 +79,9 @@ module Spec
#
# == Included helper methods
#
- # You can include helper methods in multiple contexts by expressing them
- # within a module, and then including that module in your context:
+ # You can include helper methods in multiple example groups by expressing
+ # them within a module, and then including that module in your example
+ # groups:
#
# module AccountExampleHelperMethods
# def helper_method
@@ -101,7 +103,7 @@ module Spec
#
# == Shared Example Groups
#
- # You can define a shared Example Group, that may be used on other groups
+ # You can define a shared example group, that may be used on other groups
#
# share_examples_for "All Editions" do
# it "all editions behaviour" ...

0 comments on commit f71c084

Please sign in to comment.