Class: Protest::TestCase::TestWrapper
- Inherits:
-
Object
- Object
- Protest::TestCase::TestWrapper
- Defined in:
- lib/protest/test_case.rb
Overview
Provides the TestCase API for global setup/teardown blocks, so they can be “faked” as tests into the reporter (they aren’t counted towards the total number of tests but they could count towards the number of failures/errors.)
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(type, test_case) ⇒ TestWrapper
constructor
A new instance of TestWrapper.
- #raise_exceptions? ⇒ Boolean
-
#real? ⇒ Boolean
This is not a real test but a fake one.
- #run(report) ⇒ Object
Constructor Details
#initialize(type, test_case) ⇒ TestWrapper
Returns a new instance of TestWrapper.
262 263 264 265 266 |
# File 'lib/protest/test_case.rb', line 262 def initialize(type, test_case) @type = type @test = test_case @name = "Global #{@type} for #{test_case.description}" end |
Instance Attribute Details
#name ⇒ Object (readonly)
:nodoc:
260 261 262 |
# File 'lib/protest/test_case.rb', line 260 def name @name end |
Instance Method Details
#raise_exceptions? ⇒ Boolean
272 273 274 |
# File 'lib/protest/test_case.rb', line 272 def raise_exceptions? true end |
#real? ⇒ Boolean
This is not a real test but a fake one
277 278 279 |
# File 'lib/protest/test_case.rb', line 277 def real? false end |
#run(report) ⇒ Object
268 269 270 |
# File 'lib/protest/test_case.rb', line 268 def run(report) @test.send("do_global_#{@type}") end |