Class: ActiveSupport::TestCase
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
ActionController::TestCase, ActionDispatch::IntegrationTest, ActionDispatch::SystemTestCase, ActionMailer::TestCase, ActionView::TestCase, ActiveJob::TestCase, Rails::Generators::TestCase
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Testing::Declarative ,
Minitest::Test
|
|
Instance Chain:
self,
::ActiveRecord::TestFixtures ,
Testing::FileFixtures ,
Testing::TimeHelpers ,
Testing::Assertions ,
Testing::SetupAndTeardown ,
Minitest::Test
|
|
Inherits: |
Minitest::Test
|
Defined in: | activesupport/lib/active_support/test_case.rb, railties/lib/rails/test_help.rb |
Constant Summary
::ActiveRecord::TestFixtures
- Attributes & Methods
- .config rw
- #config rw
- .config? ⇒ Boolean rw
- #config? ⇒ Boolean rw
- .fixture_class_names rw
- #fixture_class_names rw
- .fixture_class_names? ⇒ Boolean rw
- #fixture_class_names? ⇒ Boolean rw
- .fixture_path rw
- #fixture_path readonly
- .fixture_path? ⇒ Boolean rw
- #fixture_path? ⇒ Boolean readonly
- .fixture_table_names rw
- #fixture_table_names rw
- .fixture_table_names? ⇒ Boolean rw
- #fixture_table_names? ⇒ Boolean rw
- .pre_loaded_fixtures rw
- #pre_loaded_fixtures rw
- .pre_loaded_fixtures? ⇒ Boolean rw
- #pre_loaded_fixtures? ⇒ Boolean rw
- .use_instantiated_fixtures rw
- #use_instantiated_fixtures rw
- .use_instantiated_fixtures? ⇒ Boolean rw
- #use_instantiated_fixtures? ⇒ Boolean rw
- .use_transactional_tests rw
- #use_transactional_tests rw
- .use_transactional_tests? ⇒ Boolean rw
- #use_transactional_tests? ⇒ Boolean rw
Testing::FileFixtures
- Attributes & Methods
- .file_fixture_path rw
- #file_fixture_path readonly
- .file_fixture_path? ⇒ Boolean rw
- #file_fixture_path? ⇒ Boolean readonly
Class Attribute Summary
-
.test_order
rw
Returns the order in which test cases are run.
-
.test_order=(new_order)
rw
Sets the order in which test cases are run.
Class Method Summary
Testing::Declarative
- Extended
Instance Attribute Summary
::ActiveRecord::TestFixtures
- Included
Instance Method Summary
- #assert_no_match
- #assert_not_empty
- #assert_not_equal
- #assert_not_in_delta
- #assert_not_in_epsilon
- #assert_not_includes
- #assert_not_instance_of
- #assert_not_kind_of
- #assert_not_nil
- #assert_not_operator
- #assert_not_predicate
- #assert_not_respond_to
- #assert_not_same
-
#assert_raise
test/unit backwards compatibility methods.
- #method_name
::ActiveRecord::TestFixtures
- Included
Testing::FileFixtures
- Included
#file_fixture | Returns a |
Testing::TimeHelpers
- Included
#after_teardown, | |
#freeze_time | Calls |
#travel | Changes current time to the time in the future or in the past by a given time difference by stubbing |
#travel_back | Returns the current time back to its original state, by removing the stubs added by |
#travel_to | Changes current time to the given time by stubbing |
Testing::Assertions
- Included
#assert_changes | Assertion that the result of evaluating an expression is changed before and after invoking the passed in block. |
#assert_difference | Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block. |
#assert_no_changes | Assertion that the result of evaluating an expression is not changed before and after invoking the passed in block. |
#assert_no_difference | Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block. |
#assert_not | Asserts that an expression is not truthy. |
#assert_nothing_raised | Assertion that the block should not raise an exception. |
Class Attribute Details
.config (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
.config? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
.file_fixture_path (rw)
[ GitHub ]# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
.file_fixture_path? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
.fixture_class_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
.fixture_class_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
.fixture_path (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
.fixture_path? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
.fixture_table_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
.fixture_table_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
.pre_loaded_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
.pre_loaded_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
.test_order (rw)
Returns the order in which test cases are run.
ActiveSupport::TestCase.test_order # => :random
Possible values are :random
, :parallel
, :alpha
, :sorted
. Defaults to :random
.
# File 'activesupport/lib/active_support/test_case.rb', line 39
def test_order ActiveSupport.test_order ||= :random end
.test_order=(new_order) (rw)
Sets the order in which test cases are run.
ActiveSupport::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 'activesupport/lib/active_support/test_case.rb', line 29
def test_order=(new_order) ActiveSupport.test_order = new_order end
.use_instantiated_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
.use_instantiated_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
.use_transactional_tests (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
.use_transactional_tests? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
Instance Attribute Details
#config (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
#config? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
#file_fixture_path (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
#file_fixture_path? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
#fixture_class_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
#fixture_class_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
#fixture_path (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
#fixture_path? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
#fixture_table_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
#fixture_table_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
#pre_loaded_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
#pre_loaded_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
#use_instantiated_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
#use_instantiated_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
#use_transactional_tests (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
#use_transactional_tests? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
Instance Method Details
#assert_no_match
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 63
alias :assert_no_match :refute_match
#assert_not_empty
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 56
alias :assert_not_empty :refute_empty
#assert_not_equal
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 57
alias :assert_not_equal :refute_equal
#assert_not_in_delta
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 58
alias :assert_not_in_delta :refute_in_delta
#assert_not_in_epsilon
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 59
alias :assert_not_in_epsilon :refute_in_epsilon
#assert_not_includes
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 60
alias :assert_not_includes :refute_includes
#assert_not_instance_of
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 61
alias :assert_not_instance_of :refute_instance_of
#assert_not_kind_of
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 62
alias :assert_not_kind_of :refute_kind_of
#assert_not_nil
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 64
alias :assert_not_nil :refute_nil
#assert_not_operator
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 65
alias :assert_not_operator :refute_operator
#assert_not_predicate
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 66
alias :assert_not_predicate :refute_predicate
#assert_not_respond_to
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 67
alias :assert_not_respond_to :refute_respond_to
#assert_not_same
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 68
alias :assert_not_same :refute_same
#assert_raise
test/unit backwards compatibility methods
# File 'activesupport/lib/active_support/test_case.rb', line 55
alias :assert_raise :assert_raises
#method_name
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 44
alias_method :method_name, :name