Class: CoreExt::TestCase
- Extended by:
- CoreExt::Testing::Declarative
- Includes:
- CoreExt::Testing::Assertions, CoreExt::Testing::FileFixtures, CoreExt::Testing::SetupAndTeardown, CoreExt::Testing::TaggedLogging, CoreExt::Testing::TimeHelpers
- Defined in:
- lib/core_ext/test_case.rb
Constant Summary collapse
- Assertion =
Minitest::Assertion
Class Method Summary collapse
- .run(reporter, options = {}) ⇒ Object
-
.test_order ⇒ Object
Returns the order in which test cases are run.
-
.test_order=(new_order) ⇒ Object
Sets the order in which test cases are run.
Instance Method Summary collapse
-
#assert_nothing_raised(*args) ⇒ Object
Reveals the intention that the block should not raise any exception.
Methods included from CoreExt::Testing::Declarative
Methods included from CoreExt::Testing::FileFixtures
Methods included from Concern
#append_features, #class_methods, extended, #included
Methods included from CoreExt::Testing::TimeHelpers
#travel, #travel_back, #travel_to
Methods included from CoreExt::Testing::Assertions
#assert_difference, #assert_no_difference, #assert_not
Methods included from CoreExt::Testing::SetupAndTeardown
#after_teardown, #before_setup
Methods included from CoreExt::Testing::TaggedLogging
Class Method Details
.run(reporter, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/core_ext/test_case.rb', line 44 def run(reporter, = {}) if [:patterns] && [:patterns].any? { |p| p =~ /:\d+/ } [:filter] = \ Testing::CompositeFilter.new(self, [:filter], [:patterns]) end super end |
.test_order ⇒ Object
40 41 42 |
# File 'lib/core_ext/test_case.rb', line 40 def test_order CoreExt.test_order ||= :random end |
.test_order=(new_order) ⇒ Object
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
)
30 31 32 |
# File 'lib/core_ext/test_case.rb', line 30 def test_order=(new_order) CoreExt.test_order = new_order end |
Instance Method Details
#assert_nothing_raised(*args) ⇒ Object
Reveals the intention that the block should not raise any exception.
assert_nothing_raised do
...
end
84 85 86 |
# File 'lib/core_ext/test_case.rb', line 84 def assert_nothing_raised(*args) yield end |