Class: Faccts::RustCodeGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/faccts/03_generating_code/rust_code_generator.rb,
lib/faccts/03_generating_code/rust_test_assertion_code_generator.rb,
lib/faccts/03_generating_code/rust_name_to_function_call_converter.rb

Defined Under Namespace

Classes: BasicRustMainProgramTemplateFetcher, BasicRustTestAssertionCallTemplateFetcher, RustCodeTemplate, RustNameToFunctionCallConverter, RustTestAssertionCodeGenerator

Constant Summary collapse

NO_CODE =
""

Instance Method Summary collapse

Constructor Details

#initialize(test_assertion_generator_strategy, fixed_template_fetcher_strategy) ⇒ RustCodeGenerator

Returns a new instance of RustCodeGenerator.



7
8
9
10
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 7

def initialize(test_assertion_generator_strategy, fixed_template_fetcher_strategy)
  @test_assertion_code_generator = test_assertion_generator_strategy
  @fixed_code_template = RustCodeTemplate.new(fixed_template_fetcher_strategy)
end

Instance Method Details

#generate_from_test_suite!(test_specification_suite) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/faccts/03_generating_code/rust_code_generator.rb', line 12

def generate_from_test_suite!(test_specification_suite)
  @test_specification_suite = test_specification_suite

  return NO_CODE if test_specification_suite.empty?

  wrapped_in_fixed_code_template(code_from_test_specification_suite)
end