Class: Faccts::RustCodeGenerator::RustTestAssertionCodeGenerator
- Inherits:
-
Object
- Object
- Faccts::RustCodeGenerator::RustTestAssertionCodeGenerator
- Defined in:
- lib/faccts/03_generating_code/rust_test_assertion_code_generator.rb
Defined Under Namespace
Classes: UnnameableAssertionError
Instance Method Summary collapse
- #generate!(test_assertion) ⇒ Object
-
#initialize(function_call_converter_strategy, template_fetcher_strategy) ⇒ RustTestAssertionCodeGenerator
constructor
A new instance of RustTestAssertionCodeGenerator.
Constructor Details
#initialize(function_call_converter_strategy, template_fetcher_strategy) ⇒ RustTestAssertionCodeGenerator
Returns a new instance of RustTestAssertionCodeGenerator.
6 7 8 9 |
# File 'lib/faccts/03_generating_code/rust_test_assertion_code_generator.rb', line 6 def initialize(function_call_converter_strategy, template_fetcher_strategy) @function_call_converter = function_call_converter_strategy @code_template = RustCodeTemplate.new(template_fetcher_strategy) end |
Instance Method Details
#generate!(test_assertion) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/faccts/03_generating_code/rust_test_assertion_code_generator.rb', line 11 def generate!(test_assertion) @test_assertion = test_assertion code_template.generate_with_values(*injectable_assertion_values) rescue RustNameToFunctionCallConverter::InvalidNameError raise UnnameableAssertionError, test_assertion.action_name end |