Class: ActiveSupport::TestCase

Inherits:
Minitest::Test
  • Object
show all
Extended by:
ActiveSupport::Testing::Declarative
Includes:
ActiveRecord::TestFixtures, ActiveSupport::Testing::Assertions, ActiveSupport::Testing::Deprecation, ActiveSupport::Testing::SetupAndTeardown, ActiveSupport::Testing::TaggedLogging, ActiveSupport::Testing::TimeHelpers
Defined in:
activesupport/lib/active_support/test_case.rb,
railties/lib/rails/test_help.rb

Constant Summary collapse

Assertion =
Minitest::Assertion

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ActiveSupport::Testing::Declarative

extended, test

Methods included from ActiveRecord::TestFixtures

#after_teardown, #before_setup, #enlist_fixture_connections, #run_in_transaction?, #setup_fixtures, #teardown_fixtures

Methods included from Concern

#append_features, extended, #included

Methods included from ActiveSupport::Testing::TimeHelpers

#travel, #travel_back, #travel_to

Methods included from ActiveSupport::Testing::Deprecation

#assert_deprecated, #assert_not_deprecated, #collect_deprecations

Methods included from ActiveSupport::Testing::Assertions

#assert_difference, #assert_no_difference, #assert_not

Methods included from ActiveSupport::Testing::SetupAndTeardown

#after_teardown, #before_setup

Methods included from ActiveSupport::Testing::TaggedLogging

#before_setup

Class Method Details

.for_tag(tag) ⇒ Object



26
27
28
# File 'activesupport/lib/active_support/test_case.rb', line 26

def self.for_tag(tag)
  yield if $tags[tag]
end

Instance Method Details

#assert_nothing_raised(*args) ⇒ Object

Fails if the block raises an exception.

assert_nothing_raised do
  ...
end


62
63
64
# File 'activesupport/lib/active_support/test_case.rb', line 62

def assert_nothing_raised(*args)
  yield
end