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.



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

#nameObject (readonly)

:nodoc:



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

def name
  @name
end

Instance Method Details

#raise_exceptions?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


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