instance method
around
Ruby on Rails edge
Since edgeSignature
around(*args, &block)
Add a callback, which runs between the TestCase#setup callbacks and the TestCase#teardown callbacks. Yields the test class instance and the test case to the block:
class ClientTest < ActiveSupport::TestCase
around do |test_case, block|
# do client setup
block.call
# do client teardown
end
end
Code after a failing test yielded by the block argument will still be executed.
Parameters
-
argsrest -
blockblock
Source
# File activesupport/lib/active_support/testing/setup_and_teardown.rb, line 62
def around(*args, &block)
set_callback(:test, :around, *args, &block)
include AroundCallbackSupport unless self < AroundCallbackSupport
end
Defined in activesupport/lib/active_support/testing/setup_and_teardown.rb line 62
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Testing::SetupAndTeardown::ClassMethods