Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Sinatra

robholland edited this page Aug 13, 2010 · 33 revisions

You can use Cucumber with Sinatra and Webrat!

Just make sure you have a features/support/env.rb file with the following:


# RSpec matchers
require 'spec/expectations'

# Webrat
require 'webrat'
Webrat.configure do |config|
  config.mode = :sinatra
end

World do
  Webrat::SinatraSession.new
end

# Sinatra - my views are not in the cucumber bin dir!
$0 = File.dirname(__FILE__) + '/../../your_sinatra_app.rb'
# Note: The above didn't work for me, I do:
# set :views, File.join(File.dirname(__FILE__), 'views') in my sinatra app instead, just to be sure.

require File.dirname(__FILE__) + '/../../your_sinatra_app'

Clone this wiki locally