Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: bdb352e171
Fetching contributors…

Cannot retrieve contributors at this time

file 42 lines (32 sloc) 0.894 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#!/usr/bin/env ruby

require 'pathname'

@root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path
app_file = @root.join('lib/visage-app')

require 'rubygems'
require 'spec/expectations'
require 'rack/test'
require 'webrat'

ENV['CONFIG_PATH'] = @root.join('features/data/config/default')

require app_file
# Force the application name because polyglot breaks the auto-detection logic.
Sinatra::Application.app_file = app_file

Webrat.configure do |config|
  config.mode = :rack
end

class SinatraWorld
  include Rack::Test::Methods
  include Webrat::Methods
  include Webrat::Matchers

  Webrat::Methods.delegate_to_session :response_code, :response_body, :response_headers, :response

  def app
    Rack::Builder.new do
      use Visage::Profiles
      use Visage::Builder
      use Visage::JSON
      run Sinatra::Application
    end
  end
end

World do
  SinatraWorld.new
end
Something went wrong with that request. Please try again.