class SetupAndTeardownTest

Setup and teardown callbacks.

Public Instance Methods

setup() click to toggle source
# File activesupport/test/test_case_test.rb, line 253
def setup
end
teardown() click to toggle source
# File activesupport/test/test_case_test.rb, line 256
def teardown
end
test_inherited_setup_callbacks() click to toggle source
# File activesupport/test/test_case_test.rb, line 247
def test_inherited_setup_callbacks
  assert_equal [:reset_callback_record, :foo], self.class._setup_callbacks.map(&:raw_filter)
  assert_equal [:foo], @called_back
  assert_equal [:foo, :sentinel], self.class._teardown_callbacks.map(&:raw_filter)
end

Private Instance Methods

foo() click to toggle source
# File activesupport/test/test_case_test.rb, line 265
def foo
  @called_back << :foo
end
reset_callback_record() click to toggle source
# File activesupport/test/test_case_test.rb, line 261
def reset_callback_record
  @called_back = []
end
sentinel() click to toggle source
# File activesupport/test/test_case_test.rb, line 269
def sentinel
  assert_equal [:foo], @called_back
end