Class: RainforestRubyRuntime::Test

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:, callback:, &block) ⇒ Test

Returns a new instance of Test.



5
6
7
8
9
10
11
# File 'lib/rainforest_ruby_runtime/test.rb', line 5

def initialize(id: , title: , callback: , &block)
  @id = id
  @title = title
  @steps = []
  @block = block
  @callback = callback
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/rainforest_ruby_runtime/test.rb', line 3

def id
  @id
end

#stepsObject (readonly)

Returns the value of attribute steps.



3
4
5
# File 'lib/rainforest_ruby_runtime/test.rb', line 3

def steps
  @steps
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/rainforest_ruby_runtime/test.rb', line 3

def title
  @title
end

Instance Method Details

#runObject



13
14
15
16
17
# File 'lib/rainforest_ruby_runtime/test.rb', line 13

def run
  @callback.before_test(self)
  @block.call
  @callback.after_test(self)
end