Module: Sinatra::Tests

Defined in:
lib/sinatra/tests.rb,
lib/sinatra/tests/test_case.rb,
lib/sinatra/tests/rspec/matchers.rb,
lib/sinatra/tests/rspec/shared_specs.rb

Defined Under Namespace

Modules: RSpec, TestCase

Constant Summary collapse

VERSION =
'0.1.6'

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/sinatra/tests.rb', line 19

def self.registered(app)
  
  app.set :environment, :test
  
  app.get '/tests' do
    case params[:engine]
    when 'erb'
      erb(params[:view], :layout => params[:layout] )
    when 'haml'
      haml(params[:view], :layout => params[:layout] )
    else
      params.inspect
    end
  end
  
end

.versionObject



16
# File 'lib/sinatra/tests.rb', line 16

def self.version; "Sinatra::Tests v#{VERSION}"; end