Skip to content

Instantly share code, notes, and snippets.

@evandrix
Forked from tooky/Rakefile
Created July 6, 2011 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evandrix/1067624 to your computer and use it in GitHub Desktop.
Save evandrix/1067624 to your computer and use it in GitHub Desktop.
Sinatra + Cucumber + Webrat
require 'spec/expectations'
require 'webrat'
Webrat.configure do |config|
config.mode = :sinatra
end
World do
Webrat::SinatraSession.new
end
require 'sinatra'
get '/' do
"Hello, world!"
end
Given /^I am viewing "(.+)"$/ do |url|
visit(url)
end
Then /^I should see "(.+)"$/ do |text|
response_body.should =~ Regexp.new(Regexp.escape(text))
end
Feature: view pages
Scenario: Home page
Given I am viewing "/"
Then I should see "Hello, world!"
require 'rubygems'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "--format pretty"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment