Class: TinyTest::SuiteResult

Inherits:
Object
  • Object
show all
Defined in:
lib/tinytest.rb

Constant Summary collapse

SUCCESS_CHAR =
'.'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(suite, benchmark, report = nil) ⇒ SuiteResult

If report was ommited, it means it’s succeeded result.



287
288
289
290
291
292
293
# File 'lib/tinytest.rb', line 287

def initialize(suite, benchmark, report = nil)
  @suite     = suite
  @benchmark = benchmark
  @report    = report
  @char      = @report ? @report[0, 1] : SUCCESS_CHAR
  @success_p = !@report
end

Instance Attribute Details

#benchmarkObject (readonly)

Returns the value of attribute benchmark.



296
297
298
# File 'lib/tinytest.rb', line 296

def benchmark
  @benchmark
end

#charObject (readonly)

Returns the value of attribute char.



298
299
300
# File 'lib/tinytest.rb', line 298

def char
  @char
end

#reportObject (readonly)

Returns the value of attribute report.



297
298
299
# File 'lib/tinytest.rb', line 297

def report
  @report
end

#suiteObject (readonly)

Returns the value of attribute suite.



295
296
297
# File 'lib/tinytest.rb', line 295

def suite
  @suite
end

Instance Method Details

#inspectObject



300
301
302
# File 'lib/tinytest.rb', line 300

def inspect
  super.split(/\s+/).first << "[#{char}]>"
end

#success?Boolean

Self is succeeded result or not.

Returns:

  • (Boolean)


305
306
307
# File 'lib/tinytest.rb', line 305

def success?
  @success_p
end