Class: Testgenai::ConventionsExtractor
- Inherits:
-
Object
- Object
- Testgenai::ConventionsExtractor
- Defined in:
- lib/testgenai/conventions_extractor.rb
Constant Summary collapse
- TEST_DIRS =
%w[support controllers requests models jobs services].freeze
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(root: Dir.pwd) ⇒ ConventionsExtractor
constructor
A new instance of ConventionsExtractor.
Constructor Details
#initialize(root: Dir.pwd) ⇒ ConventionsExtractor
Returns a new instance of ConventionsExtractor.
5 6 7 |
# File 'lib/testgenai/conventions_extractor.rb', line 5 def initialize(root: Dir.pwd) @root = root end |
Instance Method Details
#extract ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/testgenai/conventions_extractor.rb', line 9 def extract file_pairs = test_files_with_paths return nil if file_pairs.empty? contents = file_pairs.map { |_, c| c } facts = [ auth_pattern(contents), unavailable_helpers, factory_traits, common_stubs(contents), transactional_specs(file_pairs) ].compact facts.empty? ? nil : facts.join("\n") end |