mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
document testing with rspec
This commit is contained in:
parent
7cfe04a905
commit
10c90d5f87
1 changed files with 21 additions and 1 deletions
22
README.rdoc
22
README.rdoc
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue