Class: RailsArchitect::Analyzers::TddAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_architect/analyzers/tdd_analyzer.rb

Overview

Analyzes test-driven development coverage and practices

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path = Rails.root) ⇒ TddAnalyzer



9
10
11
# File 'lib/rails_architect/analyzers/tdd_analyzer.rb', line 9

def initialize(project_path = Rails.root)
  @project_path = project_path
end

Instance Attribute Details

#project_pathObject (readonly)

Returns the value of attribute project_path.



7
8
9
# File 'lib/rails_architect/analyzers/tdd_analyzer.rb', line 7

def project_path
  @project_path
end

Instance Method Details

#analyzeObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/rails_architect/analyzers/tdd_analyzer.rb', line 13

def analyze
  {
    score: calculate_coverage_score,
    test_files: count_test_files,
    spec_files: count_spec_files,
    coverage_percentage: estimate_coverage,
    suggestions: generate_suggestions,
    test_structure: analyze_test_structure
  }
end