Class: Moto::Runner::TestGenerator
- Inherits:
-
Object
- Object
- Moto::Runner::TestGenerator
- Defined in:
- lib/runner/test_generator.rb
Instance Method Summary collapse
-
#get_test_with_variants(test_metadata) ⇒ Array
Method returns an array of test instances that represent all variants (parameter sets from test’s config).
-
#initialize ⇒ TestGenerator
constructor
A new instance of TestGenerator.
-
#inject_error_to_test(test, error_message) ⇒ Object
Injects raise into test.run so it will report an error when executed.
Constructor Details
#initialize ⇒ TestGenerator
Returns a new instance of TestGenerator.
10 11 12 |
# File 'lib/runner/test_generator.rb', line 10 def initialize @internal_counter = 0 end |
Instance Method Details
#get_test_with_variants(test_metadata) ⇒ Array
Method returns an array of test instances that represent all variants (parameter sets from test’s config).
Example: A test with no config file will be returned as an array with single Moto::Test::Base in it.
Example: A test with a config file and 2 sets of parameters there will be returned as array with two elements.
21 22 23 |
# File 'lib/runner/test_generator.rb', line 21 def get_test_with_variants() variantize() end |
#inject_error_to_test(test, error_message) ⇒ Object
Injects raise into test.run so it will report an error when executed
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/runner/test_generator.rb', line 94 def inject_error_to_test(test, ) class << test attr_accessor :injected_error_message def run raise end end test. = end |