Class: Strata::CLI::Generators::Test

Inherits:
Group
  • Object
show all
Defined in:
lib/strata/cli/generators/test.rb

Overview

Generates test YAML files from templates.

Instance Method Summary collapse

Methods inherited from Group

exit_on_failure?, source_root

Instance Method Details

#create_test_fileObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/strata/cli/generators/test.rb', line 13

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

  say_status :created, output_path, :green
end