Module: Inferno::DSL::Messages
- Includes:
- Utils::MarkdownFormatter
- Included in:
- Entities::TestGroup, Entities::TestSuite
- Defined in:
- lib/inferno/dsl/messages.rb
Overview
This module contains methods to add meessages to runnable results
Instance Method Summary collapse
-
#add_message(type, message) ⇒ void
Add a message to the result.
-
#info(message = nil) ⇒ void
Add an informational message to the results of a test.
- #messages ⇒ Object
-
#warning(message = nil) ⇒ void
Add a warning message to the results of a test.
Methods included from Utils::MarkdownFormatter
Instance Method Details
#add_message(type, message) ⇒ void
This method returns an undefined value.
Add a message to the result.
18 19 20 |
# File 'lib/inferno/dsl/messages.rb', line 18 def (type, ) << { type: type.to_s, message: format_markdown() } end |
#info(message = nil) ⇒ void
This method returns an undefined value.
Add an informational message to the results of a test. If passed a block, a failed assertion will become an info message and test execution will continue.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/inferno/dsl/messages.rb', line 35 def info( = nil) unless block_given? ('info', ) unless .nil? return end yield rescue Exceptions::AssertionException => e ('info', e.) end |
#messages ⇒ Object
9 10 11 |
# File 'lib/inferno/dsl/messages.rb', line 9 def @messages ||= [] end |
#warning(message = nil) ⇒ void
This method returns an undefined value.
Add a warning message to the results of a test. If passed a block, a failed assertion will become a warning message and test execution will continue.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/inferno/dsl/messages.rb', line 59 def warning( = nil) unless block_given? ('warning', ) unless .nil? return end yield rescue Exceptions::AssertionException => e ('warning', e.) end |