Class: Strata::CLI::Generators::Test
- Defined in:
- lib/strata/cli/generators/test.rb
Overview
Generates test YAML files from templates.
Constant Summary
Constants included from Output
Instance Method Summary collapse
Methods inherited from Group
Methods included from Output
format, pastel, print_error, #print_error, print_hint, #print_hint, print_info, #print_info, print_status, #print_status, print_success, #print_success, print_warning, #print_warning, shell_for, thor_color
Instance Method Details
#create_test_file ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/strata/cli/generators/test.rb', line 14 def create_test_file output_path = File.join("tests", "#{slugify(name)}.yml") # Ensure directory exists empty_directory "tests" # Load template and update with user inputs template_content = load_template updated_content = update_template(template_content) # Write the updated template create_file output_path, updated_content Output.print_status(:created, output_path, type: :success, context: self) end |