Class: Protest::TestCase::TestWrapper

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(type, test_case) ⇒ TestWrapper

Returns a new instance of TestWrapper.



237
238
239
240
241
# File 'lib/protest/test_case.rb', line 237

def initialize(type, test_case)
  @type = type
  @test = test_case
  @name = "Global #{@type} for #{test_case.description}"
end

Instance Attribute Details

#nameObject (readonly)

:nodoc:



235
236
237
# File 'lib/protest/test_case.rb', line 235

def name
  @name
end

Instance Method Details

#run(report) ⇒ Object



243
244
245
# File 'lib/protest/test_case.rb', line 243

def run(report)
  @test.send("do_global_#{@type}")
end