Permalink
Browse files

document testing with rspec

  • Loading branch information...
1 parent 7cfe04a commit 10c90d5f8759c4a10bf33b47d405ae38910baeef @sr sr committed Sep 27, 2008
Showing with 21 additions and 1 deletion.
  1. +21 −1 README.rdoc
View
@@ -397,7 +397,7 @@ typically don't have to +use+ them explicitly.
end
-=== Specs
+=== Test/Spec
require 'rubygems'
require 'sinatra'
@@ -411,6 +411,26 @@ typically don't have to +use+ them explicitly.
should.be.ok
body.should.equal 'My Default Page!'
end
+
+ ...
+
+ end
+
+=== RSpec
+
+ require 'rubygems'
+ require 'spec'
+ require 'sinatra'
+ require 'sinatra/test/rspec'
+ require 'my_sinatra_app'
+
+ describe 'My app' do
+ it 'should show a default page' do
+ get_it '/'
+ @response.should be_ok
+ @response.body.should == 'My Default Page!'
+ end
+
...
end

0 comments on commit 10c90d5

Please sign in to comment.