Class: RailsAiContext::Introspectors::TestIntrospector

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_context/introspectors/test_introspector.rb

Overview

Discovers test infrastructure: framework, factories/fixtures, system tests, helpers, CI config, coverage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ TestIntrospector

Returns a new instance of TestIntrospector.



10
11
12
# File 'lib/rails_ai_context/introspectors/test_introspector.rb', line 10

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



8
9
10
# File 'lib/rails_ai_context/introspectors/test_introspector.rb', line 8

def app
  @app
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rails_ai_context/introspectors/test_introspector.rb', line 14

def call
  {
    framework: detect_framework,
    factories: detect_factories,
    factory_names: detect_factory_names,
    fixtures: detect_fixtures,
    fixture_names: detect_fixture_names,
    system_tests: detect_system_tests,
    test_helpers: detect_test_helpers,
    test_helper_setup: detect_test_helper_setup,
    test_files: detect_test_files,
    vcr_cassettes: detect_vcr,
    ci_config: detect_ci,
    coverage: detect_coverage,
    factory_traits: detect_factory_traits,
    test_count_by_category: detect_test_count_by_category,
    shared_examples: detect_shared_examples,
    database_cleaner: detect_database_cleaner
  }
rescue => e
  { error: e.message }
end