Permalink
Browse files

Bacon support

  • Loading branch information...
Dylan Egan authored and rtomayko committed Jan 9, 2009
1 parent c00a25e commit 1fb5b99dca4ce881da9976157f41c4545a44ec67
Showing with 36 additions and 2 deletions.
  1. +3 −0 CHANGES
  2. +16 −2 README.rdoc
  3. +17 −0 lib/sinatra/test/bacon.rb
View
@@ -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.
View
@@ -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
View
@@ -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)

0 comments on commit 1fb5b99

Please sign in to comment.