public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
 
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
 
require 'miniskirt'
require 'capybara/rails'
require 'mocha'
require 'turn'
 
# Support files
Dir["#{File.expand_path(File.dirname(__FILE__))}/support/*.rb"].each do |file|
require file
end
 
 
class MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
 
alias :method_name :__name__ if defined? :__name__
end
 
 
class ControllerSpec < MiniTest::Spec
include Rails.application.routes.url_helpers
include ActionController::TestCase::Behavior
 
before do
@routes = Rails.application.routes
end
end
 
# Test subjects ending with 'Controller' are treated as functional tests
# e.g. describe TestController do ...
MiniTest::Spec.register_spec_type( /Controller$/, ControllerSpec )
 
 
class AcceptanceSpec < MiniTest::Spec
include Rails.application.routes.url_helpers
include Capybara::DSL
 
before do
@routes = Rails.application.routes
end
end
 
# Test subjects ending with 'Integration' are treated as acceptance/integration tests
# e.g. describe 'Test system Integration' do ...
MiniTest::Spec.register_spec_type( /Integration$/, AcceptanceSpec )
 
 
Turn.config do |c|
# use one of output formats:
# :outline - turn's original case/test outline mode [default]
# :progress - indicates progress with progress bar
# :dotted - test/unit's traditional dot-progress mode
# :pretty - new pretty reporter
# :marshal - dump output as YAML (normal run mode only)
# :cue - interactive testing
c.format = :cue
# turn on invoke/execute tracing, enable full backtrace
c.trace = true
# use humanized test names (works only with :outline format)
c.natural = true
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.