Class: Moto::Test::Generator
- Inherits:
-
Object
- Object
- Moto::Test::Generator
- Defined in:
- lib/test/generator.rb
Instance Method Summary collapse
-
#get_test_with_variants(test_metadata, variants_limit = 0) ⇒ Array
Method returns an array of test instances that represent all variants (parameter sets from test’s config).
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
-
#inject_error_to_test(test, error_message) ⇒ Object
Injects raise into test.run so it will report an error when executed.
Constructor Details
#initialize ⇒ Generator
Returns a new instance of Generator.
12 13 14 |
# File 'lib/test/generator.rb', line 12 def initialize @internal_counter = 0 end |
Instance Method Details
#get_test_with_variants(test_metadata, variants_limit = 0) ⇒ 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.
24 25 26 |
# File 'lib/test/generator.rb', line 24 def get_test_with_variants(, variants_limit = 0) variantize(, variants_limit) end |
#inject_error_to_test(test, error_message) ⇒ Object
Injects raise into test.run so it will report an error when executed
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/test/generator.rb', line 111 def inject_error_to_test(test, ) class << test attr_accessor :injected_error_message def run raise end end test. = end |