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.



250
251
252
253
254
# File 'lib/protest/test_case.rb', line 250

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

Instance Attribute Details

#nameObject (readonly)

:nodoc:



248
249
250
# File 'lib/protest/test_case.rb', line 248

def name
  @name
end

Instance Method Details

#context_descriptionObject



260
261
262
# File 'lib/protest/test_case.rb', line 260

def context_description
  @test.description
end

#run(report) ⇒ Object



256
257
258
# File 'lib/protest/test_case.rb', line 256

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