Bacon support
This commit is contained in:
parent
c00a25ee41
commit
1fb5b99dca
3
CHANGES
3
CHANGES
|
@ -41,6 +41,9 @@
|
|||
has the status code specified. It's also possible to register an error
|
||||
page for a range of status codes: "error(500..599)".
|
||||
|
||||
* Added support for Bacon (test framework). The 'sinatra/test/bacon' file
|
||||
can be required to setup Sinatra test helpers on Bacon::Context.
|
||||
|
||||
* Deprecated "set_option" and "set_options"; use "set" instead.
|
||||
|
||||
* Deprecated the "env" option ("options.env"); use "environment" instead.
|
||||
|
|
18
README.rdoc
18
README.rdoc
|
@ -443,8 +443,22 @@ your app:
|
|||
|
||||
end
|
||||
|
||||
See Sinatra::Test::Methods for more information on +get_it+, +post_it+,
|
||||
+put_it+, and friends.
|
||||
=== Bacon
|
||||
|
||||
require 'sinatra'
|
||||
require 'sinatra/test/bacon'
|
||||
require 'my_sinatra_app'
|
||||
|
||||
describe 'My app' do
|
||||
it 'should be ok' do
|
||||
get '/'
|
||||
should.be.ok
|
||||
body.should == 'Im OK'
|
||||
end
|
||||
end
|
||||
|
||||
See Sinatra::Test for more information on +get+, +post+, +put+, and
|
||||
friends.
|
||||
|
||||
== Command line
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
require 'bacon'
|
||||
require 'sinatra/test'
|
||||
|
||||
Sinatra::Default.set(
|
||||
:env => :test,
|
||||
:run => false,
|
||||
:raise_errors => true,
|
||||
:logging => false
|
||||
)
|
||||
|
||||
module Sinatra::Test
|
||||
def should
|
||||
@response.should
|
||||
end
|
||||
end
|
||||
|
||||
Bacon::Context.send(:include, Sinatra::Test)
|
Loading…
Reference in New Issue