Sha256: 1ea0303eccf198622187202b0d914f2023e7a60c456f08efa2cf2e8d74931bbc

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
gem 'rack-test'
require 'rack/test'
$: << File.expand_path('../../../renee_core/lib', __FILE__)
$: << File.expand_path('../../../renee_render/lib', __FILE__)
$: << File.expand_path('../../lib', __FILE__)
require 'renee'

class ColoredIO
  ESC = "\e["
  NND = "#{ESC}0m"

  def initialize(io)
    @io = io
  end

  def print(o)
    case o
    when "."
      @io.send(:print, "#{ESC}32m#{o}#{NND}")
    when "E"
      @io.send(:print, "#{ESC}33m#{o}#{NND}")
    when "F"
      @io.send(:print, "#{ESC}31m#{o}#{NND}")
    else
      @io.send(:print, o)
    end
  end

  def puts(*o)
    super
  end
end

MiniTest::Unit.output = ColoredIO.new(MiniTest::Unit.output)

## TEST HELPERS
class MiniTest::Spec
  include Rack::Test::Methods

  def default_views_path
    File.dirname(__FILE__) + "/views"
  end

  def blog_app
    file = File.join(File.dirname(__FILE__), '..', 'examples', 'blog', 'config.ru')
    Rack::Lint.new(Rack::Builder.parse_file(file)[0])
  end

  def app
    @app
  end

  alias :response :last_response
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
renee-0.3.11 test/test_helper.rb
renee-0.3.10 test/test_helper.rb
renee-0.3.7 test/test_helper.rb
renee-0.3.6 test/test_helper.rb
renee-0.3.2 test/test_helper.rb
renee-0.3.1 test/test_helper.rb
renee-0.3.0 test/test_helper.rb