Class: RubynCode::Tools::RunSpecs

Inherits:
Base
  • Object
show all
Defined in:
lib/rubyn_code/tools/run_specs.rb

Constant Summary collapse

TOOL_NAME =
'run_specs'
DESCRIPTION =
'Runs RSpec or Minitest specs. Auto-detects which test framework is in use.'
PARAMETERS =
{
  path: {
    type: :string, required: false,
    description: 'Specific test file or directory to run'
  },
  format: {
    type: :string, required: false, default: 'documentation',
    description: "Output format (default: 'documentation')"
  },
  fail_fast: {
    type: :boolean, required: false,
    description: 'Stop on first failure'
  }
}.freeze
RISK_LEVEL =
:execute
REQUIRES_CONFIRMATION =
false

Instance Attribute Summary

Attributes inherited from Base

#project_root

Instance Method Summary collapse

Methods inherited from Base

description, #initialize, parameters, requires_confirmation?, risk_level, #safe_path, summarize, to_schema, tool_name, #truncate

Constructor Details

This class inherits a constructor from RubynCode::Tools::Base

Instance Method Details

#execute(path: nil, format: 'documentation', fail_fast: false) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/rubyn_code/tools/run_specs.rb', line 29

def execute(path: nil, format: 'documentation', fail_fast: false)
  framework = detect_framework

  command = build_command(framework, path, format, fail_fast)
  stdout, stderr, status = safe_capture3(command, chdir: project_root)

  build_output(stdout, stderr, status)
end