Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holysugar/6b0acd989f11487020d1 to your computer and use it in GitHub Desktop.
Save holysugar/6b0acd989f11487020d1 to your computer and use it in GitHub Desktop.
test-unit を rails 4.2 で使う
# Rails で test-unit を使う. 参考:
# * https://github.com/test-unit/test-unit-activesupport
# * https://github.com/rails/rails/blob/master/activesupport/lib/active_support/test_case.rb
#
require 'minitest'
def Minitest.autorun; end # remove Minitest at_exit process
require 'active_support/test_case'
require 'active_support/testing/tagged_logging'
require 'active_support/testing/assertions'
require 'active_support/testing/time_helpers'
require 'active_support/testing/isolation'
require 'test/unit'
module ActiveSupport
if const_defined?(:TestCase)
remove_const :TestCase
end
class TestCase < ::Test::Unit::TestCase
include ActiveSupport::Testing::TaggedLogging
include ActiveSupport::Testing::Assertions
include ActiveSupport::Testing::TimeHelpers
private
def mu_pp(object)
AssertionMessage.convert(object)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment