class CoreExt::TestCase

Constants

Assertion

Public Class Methods

run(reporter, options = {}) click to toggle source
Calls superclass method
# File lib/core_ext/test_case.rb, line 44
def run(reporter, options = {})
  if options[:patterns] && options[:patterns].any? { |p| p =~ /:\d+/ }
    options[:filter] = \
      Testing::CompositeFilter.new(self, options[:filter], options[:patterns])
  end

  super
end
test_order() click to toggle source

Returns the order in which test cases are run.

CoreExt::TestCase.test_order # => :random

Possible values are :random, :parallel, :alpha, :sorted. Defaults to :random.

# File lib/core_ext/test_case.rb, line 40
def test_order
  CoreExt.test_order ||= :random
end
test_order=(new_order) click to toggle source

Sets the order in which test cases are run.

CoreExt::TestCase.test_order = :random # => :random

Valid values are:

  • :random (to run tests in random order)

  • :parallel (to run tests in parallel)

  • :sorted (to run tests alphabetically by method name)

  • :alpha (equivalent to :sorted)

# File lib/core_ext/test_case.rb, line 30
def test_order=(new_order)
  CoreExt.test_order = new_order
end

Public Instance Methods

assert_nothing_raised(*args) { || ... } click to toggle source

Reveals the intention that the block should not raise any exception.

assert_nothing_raised do
  ...
end
# File lib/core_ext/test_case.rb, line 85
def assert_nothing_raised(*args)
  yield
end