Created
June 13, 2009 20:35
-
-
Save aslakhellesoy/129423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Whatsnext | |
class Application < Sinatra::Base | |
post '/features/*' do | |
puts request.body.read | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec | |
require 'spec/expectations' | |
# Webrat | |
require 'rack/test' | |
require 'webrat/sinatra' | |
Webrat.configure do |config| | |
config.mode = :sinatra | |
end | |
World(Webrat::Matchers, Webrat::HaveTagMatcher, Rack::Test::Methods) do | |
context = OpenStruct.new(:app => Whatsnext::Application) | |
Webrat::SinatraSession.new(context) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When /^I save it as an existing file$/ do | |
post("/foo", 'bar') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment