Class: RainforestRubyRuntime::Test
- Inherits:
-
Object
- Object
- RainforestRubyRuntime::Test
- Defined in:
- lib/rainforest_ruby_runtime/test.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(id:, title:, &block) ⇒ Test
constructor
A new instance of Test.
- #method_missing(name, *args, &block) ⇒ Object
- #run ⇒ Object
- #step(**args, &block) ⇒ Object
Constructor Details
#initialize(id:, title:, &block) ⇒ Test
Returns a new instance of Test.
5 6 7 8 9 10 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 5 def initialize(id: , title: , &block) @id = id @title = title @steps = [] @block = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 25 def method_missing(name, *args, &block) if Variables.scope_registery.has_variable?(name) Variables.scope_registery[name] else super end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 3 def id @id end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
3 4 5 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 3 def steps @steps end |
#title ⇒ Object (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
#run ⇒ Object
19 20 21 22 23 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 19 def run extend RSpec::Matchers extend ::DSL instance_eval &@block end |
#step(**args, &block) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/rainforest_ruby_runtime/test.rb', line 12 def step(**args, &block) step = Step.new(**args, &block) @steps << step step.run step end |