Class: Smartest::SuiteRun

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ SuiteRun

Returns a new instance of SuiteRun.



7
8
9
10
11
# File 'lib/smartest/suite_run.rb', line 7

def initialize(&block)
  @block = block
  @ran = false
  @result = nil
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



5
6
7
# File 'lib/smartest/suite_run.rb', line 5

def result
  @result
end

Instance Method Details

#ran?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/smartest/suite_run.rb', line 20

def ran?
  @ran
end

#runObject



13
14
15
16
17
18
# File 'lib/smartest/suite_run.rb', line 13

def run
  raise AroundSuiteRunError, "around_suite hook called suite.run more than once" if ran?

  @ran = true
  @result = @block.call
end