Sha256: 6215280278e2031661b392c7e8b6ad994ace06777de4c42b505abc76d8bb2c05

Contents?: true

Size: 668 Bytes

Versions: 7

Compression:

Stored size: 668 Bytes

Contents

require 'contest'
require 'rack/test'
require 'mocha/setup'

ENV['RACK_ENV'] = 'test'

require File.expand_path('../app/app.rb', __FILE__)

class UnitTest < Test::Unit::TestCase
  include Rack::Test::Methods

  def app
    Main
  end

  def d
    puts "-"*80
    puts "#{last_response.status}"
    y last_response.original_headers
    puts "-"*80
    puts ""
    puts last_response.body.gsub(/^/m, '    ')
    puts ""
  end

  def body
    last_response.body.strip
  end

  def r(*a)
    File.join app.root, *a
  end

  def assert_includes(haystack, needle)
    assert haystack.include?(needle), "Expected #{haystack.inspect} to include #{needle.inspect}."
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sinatra-assetpack-0.3.5 test/test_helper.rb
sinatra-assetpack-0.3.3 test/test_helper.rb
sinatra-assetpack-0.3.2 test/test_helper.rb
sinatra-assetpack-0.3.1 test/test_helper.rb
sinatra-assetpack-0.3.0 test/test_helper.rb
sinatra-assetpack-0.2.8 test/test_helper.rb
sinatra-assetpack-0.2.7 test/test_helper.rb