Permalink
Browse files

add links to rdoc

  • Loading branch information...
1 parent bbb1a75 commit 53ab8ad7f1822d03c03df262ca7c2b2348c9a166 @dchelimsky dchelimsky committed Oct 2, 2011
Showing with 90 additions and 9 deletions.
  1. +1 −1 features/.nav
  2. +78 −0 features/GettingStarted.md
  3. +11 −8 features/README.md
View
2 features/.nav
@@ -1,3 +1,3 @@
-- TwoMinuteTutorial.md (Two minute tutorial)
+- GettingStarted.md (Getting started)
- ReleasePolicy.md (Release policy)
- GemVersions.md (Gem versions)
View
78 features/GettingStarted.md
@@ -0,0 +1,78 @@
+### Prerequisites
+
+* Ruby 1.8.6 or higher
+* Rubygems 1.3.7
+
+### Install
+
+ gem install rspec
+
+This installs four gems:
+
+* rspec
+* rspec-core
+* rspec-expectations
+* rspec-mocks
+
+The rspec-core gem installs an `rspec` executable. Run the `rspec` command with
+the `--help` flag to see the available options:
+
+ rspec --help
+
+### Getting started
+
+Begin with a very simple example that expresses some basic desired behaviour.
+
+ # game_spec.rb
+
+ describe Game do
+ describe "#score" do
+ it "returns 0 for all gutter game" do
+ game = Game.new
+ 20.times { game.roll(0) }
+ game.score.should == 0
+ end
+ end
+ end
+
+Run the example and watch it fail.
+
+<pre style="color:red;">
+$ rspec game_spec.rb
+ uninitialized constant Object::Game (NameError)
+</pre>
+
+Now write just enough code to make it pass.
+
+<pre>
+# game_spec.rb
+
+require './game'
+...
+</pre>
+
+<pre>
+# game.rb
+
+class Game
+ def roll(pins)
+ end
+
+ def score
+ 0
+ end
+end
+</pre>
+
+Run the example and bask in the joy that is green.
+
+<pre style="color:green;">
+$ rspec game_spec.rb --color --format doc
+
+Game
+ #score
+ returns 0 for all gutter game
+
+Finished in 0.00057 seconds
+1 example, 0 failures
+</pre>
View
19 features/README.md
@@ -1,6 +1,3 @@
-<br/>
-<br/>
-
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an
approach to software development that combines Test-Driven Development, Domain
Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD
@@ -9,11 +6,17 @@ part of that equation, focusing on the documentation and design aspects of TDD.
### Documentation
This is the official documentation site for RSpec-2. Much of the documentation
-you see here is written with another BDD tool called
-[Cucumber](http://github.com/cucumber/cucumber), which, like RSpec,
-provides _executable documentation_. The Cucumber features you see here have
-all been run against RSpec's codebase, serving as specification, documentation
-_and_ regression tests of the behavior.
+you see here is written with [Cucumber](http://github.com/cucumber/cucumber),
+which, like RSpec, provides _executable documentation_. The Cucumber features
+you see here have all been run against RSpec's codebase, serving as
+specification, documentation _and_ regression tests of the behavior.
+
+You can also find the RDoc for each sub-project at:
+
+* [rspec-core](http://rubydoc.info/gems/rspec-core/frames)
+* [rspec-expectations](http://rubydoc.info/gems/rspec-expectations/frames)
+* [rspec-mocks](http://rubydoc.info/gems/rspec-mocks/frames)
+* [rspec-rails](http://rubydoc.info/gems/rspec-rails/frames)
You can find documentation for rspec-1 at [http://old.rspec.info](http://old.rspec.info)

0 comments on commit 53ab8ad

Please sign in to comment.