Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 472 Bytes

Testing with Bacon

After installing [Bacon][bc], setting it up works similar to Test::Unit:

ENV['RACK_ENV'] = 'test'
require 'bacon'
require 'rack/test'

begin 
  require_relative 'my-app.rb'
rescue NameError
  require File.expand_path('my-app.rb', __FILE__)
end

module TestMixin
  include Rack::Test::Methods
  Bacon::Context.send(:include, self)
  def app() Sinatra::Application end
end
Jump to Line
Something went wrong with that request. Please try again.