OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
ruby
/
vendor_ruby
/
test
/
unit
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
assertion-failed-error.rb
748 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
assertions.rb
74 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
attribute-matcher.rb
431 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
attribute.rb
6.85 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
auto-runner-loader.rb
379 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
autorunner.rb
16.29 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
code-snippet-fetcher.rb
1.49 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
collector
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
collector.rb
1.81 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
color-scheme.rb
7.12 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
color.rb
2.95 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
data.rb
8.34 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
diff.rb
25.42 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
error.rb
3.61 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
exception-handler.rb
2.7 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
failure.rb
5.09 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
fault-location-detector.rb
2.72 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
fixture.rb
9.03 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
notification.rb
3.34 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
omission.rb
4.5 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
pending.rb
3.61 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
priority.rb
4.39 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
runner
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
test-suite-creator.rb
2.69 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testcase.rb
23.96 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testresult.rb
3.2 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testsuite.rb
4.8 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
ui
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📁
util
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
version.rb
58 bytes
07/04/2017 08:50:15 PM
rw-r--r--
Editing: exception-handler.rb
Close
module Test module Unit module ExceptionHandler @@exception_handlers = [] class << self def exception_handlers @@exception_handlers end def included(base) base.extend(ClassMethods) observer = Proc.new do |test_case, _, _, value, method_name| if value @@exception_handlers.unshift(method_name) else @@exception_handlers.delete(method_name) end end base.register_attribute_observer(:exception_handler, &observer) end end module ClassMethods def exception_handlers ExceptionHandler.exception_handlers end # @overload exception_handler(method_name) # Add an exception handler method. # # @param method_name [Symbol] # The method name that handles exception raised in tests. # @return [void] # # @overload exception_handler(&callback) # Add an exception handler. # # @yield [test, exception] # Gives the test and the exception. # @yieldparam test [Test::Unit::TestCase] # The test where the exception is raised. # @yieldparam exception [Exception] # The exception that is raised in running the test. # @yieldreturn [Boolean] # Whether the handler handles the exception or not. # The handler must return _true_ if the handler handles # test exception, _false_ otherwise. # @return [void] # # This is a public API for developers who extend test-unit. def exception_handler(*method_name_or_handlers, &block) if block_given? exception_handlers.unshift(block) else method_name_or_handlers.each do |method_name_or_handler| if method_name_or_handler.respond_to?(:call) handler = method_name_or_handler exception_handlers.unshift(handler) else method_name = method_name_or_handler attribute(:exception_handler, true, {}, method_name) end end end end def unregister_exception_handler(*method_name_or_handlers) method_name_or_handlers.each do |method_name_or_handler| if method_name_or_handler.respond_to?(:call) handler = method_name_or_handler exception_handlers.delete(handler) else method_name = method_name_or_handler attribute(:exception_handler, false, {}, method_name) end end end end end end end