Sha256: 5b361e3b7437fec4664fefc1b32ba89e53c81e87fff7f8f34b31d46cc718e957

Contents?: true

Size: 892 Bytes

Versions: 5

Compression:

Stored size: 892 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'pathname'

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

require 'rack/test'
require 'webrat'

ENV['CONFIG_PATH'] = @root.join('features/support/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
      use Visage::Meta
      run Sinatra::Application
    end
  end
end

World do
  SinatraWorld.new
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
visage-app-2.1.0 features/support/env.rb
visage-app-2.0.5 features/support/env.rb
visage-app-2.0.4 features/support/env.rb
visage-app-2.0.2 features/support/env.rb
visage-app-2.0.0 features/support/env.rb