Class: RailsArchitect::Analyzers::BddAnalyzer

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

Overview

Analyzes behavior-driven development practices in Rails projects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path = Rails.root) ⇒ BddAnalyzer

Returns a new instance of BddAnalyzer.



9
10
11
# File 'lib/rails_architect/analyzers/bdd_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/bdd_analyzer.rb', line 7

def project_path
  @project_path
end

Instance Method Details

#analyzeObject



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

def analyze
  {
    has_cucumber: cucumber?,
    has_rspec: rspec?,
    feature_files_count: count_feature_files,
    step_definitions_count: count_step_definitions,
    score: calculate_bdd_score,
    suggestions: generate_suggestions,
    practices: check_bdd_practices
  }
end