Sha256: c462b473d3ed77ea80dd704c7eb66e8d23845dda7ed30942b2656f5acf06b17f

Contents?: true

Size: 1.45 KB

Versions: 22

Compression:

Stored size: 1.45 KB

Contents

get '/jspec/*' do |path|
  send_file JSPEC_ROOT + '/lib/' + path
end

post '/results' do
  require 'json/pure'
  data = JSON.parse request.body.read
  if data['options'].include?('verbose') && data['options']['verbose'] ||
     data['options'].include?('failuresOnly') && data['options']['failuresOnly']
    puts "\n\n %s Passes: %s Failures: %s\n\n" % [
      bold(browser_name), 
      green(data['stats']['passes']), 
      red(data['stats']['failures'])]
    data['results'].compact.each do |suite|
      specs = suite['specs'].compact.map do |spec|
        case spec['status'].to_sym
        when :pass 
          next if data['options'].include?('failuresOnly') && data['options']['failuresOnly']
          '  ' + green(spec['description']) + assertion_graph_for(spec['assertions']).to_s + "\n"
        when :fail
          "  #{red(spec['description'])}\n  #{spec['message']}\n\n"
        else
          "  #{blue(spec['description'])}\n" 
        end
      end.join
      unless specs.strip.empty?
        puts "\n " + bold(suite['description']) 
        puts specs
      end
    end
  else
    puts "%20s Passes: %s Failures: %s" % [
      bold(browser_name), 
      green(data['stats']['passes']), 
      red(data['stats']['failures'])]
  end
  halt 200
end

get '/*' do |path|
  pass unless File.exists? path
  send_file path
end

#--
# Simulation Routes
#++

get '/slow/*' do |seconds|
  sleep seconds.to_i
  halt 200
end

get '/status/*' do |code|
  halt code.to_i
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
bootcamp-0.1.4 vendor/test_suites/jspec/src/routes.rb
bootcamp-0.1.0 vendor/test_suites/jspec/src/routes.rb
jspec-4.3.2 src/routes.rb
jspec-steventux-3.3.2.1 src/routes.rb
jspec-steventux-3.3.2 src/routes.rb
jspec-4.3.1 src/routes.rb
jspec-4.3.0 src/routes.rb
jspec-4.2.1 src/routes.rb
jspec-4.2.0 src/routes.rb
jspec-4.1.0 src/routes.rb
jspec-4.0.0 src/routes.rb
jspec-3.3.3 src/routes.rb
jspec-3.3.2 src/routes.rb
jspec-3.3.1 src/routes.rb
jspec-3.3.0 src/routes.rb
jspec-3.2.1 src/routes.rb
jspec-3.2.0 src/routes.rb
jspec-3.1.3 src/routes.rb
jspec-3.1.2 src/routes.rb
jspec-3.1.1 src/routes.rb