Class: RailsProof::AiTestExecutor
- Inherits:
-
Object
- Object
- RailsProof::AiTestExecutor
- Defined in:
- lib/rails_proof/ai_test_executor.rb
Defined Under Namespace
Classes: Result
Instance Attribute Summary collapse
-
#concerns ⇒ Object
readonly
Returns the value of attribute concerns.
-
#review_store ⇒ Object
readonly
Returns the value of attribute review_store.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#runner_class ⇒ Object
readonly
Returns the value of attribute runner_class.
-
#superclass ⇒ Object
readonly
Returns the value of attribute superclass.
-
#target_path ⇒ Object
readonly
Returns the value of attribute target_path.
-
#test_class_name ⇒ Object
readonly
Returns the value of attribute test_class_name.
-
#test_file_path ⇒ Object
readonly
Returns the value of attribute test_file_path.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(root:, test_file_path:, test_class_name:, superclass:, concerns:, target_path: nil, runner_class: RailsProof::TestRunner, review_store: nil) ⇒ AiTestExecutor
constructor
A new instance of AiTestExecutor.
Constructor Details
#initialize(root:, test_file_path:, test_class_name:, superclass:, concerns:, target_path: nil, runner_class: RailsProof::TestRunner, review_store: nil) ⇒ AiTestExecutor
Returns a new instance of AiTestExecutor.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rails_proof/ai_test_executor.rb', line 45 def initialize( root:, test_file_path:, test_class_name:, superclass:, concerns:, target_path: nil, runner_class: RailsProof::TestRunner, review_store: nil ) @root = Pathname.new(root) @target_path = target_path @test_file_path = test_file_path @test_class_name = test_class_name @superclass = superclass @concerns = concerns @runner_class = runner_class @review_store = review_store || RailsProof::ReviewStore.new(root: @root) end |
Instance Attribute Details
#concerns ⇒ Object (readonly)
Returns the value of attribute concerns.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def concerns @concerns end |
#review_store ⇒ Object (readonly)
Returns the value of attribute review_store.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def review_store @review_store end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def root @root end |
#runner_class ⇒ Object (readonly)
Returns the value of attribute runner_class.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def runner_class @runner_class end |
#superclass ⇒ Object (readonly)
Returns the value of attribute superclass.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def superclass @superclass end |
#target_path ⇒ Object (readonly)
Returns the value of attribute target_path.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def target_path @target_path end |
#test_class_name ⇒ Object (readonly)
Returns the value of attribute test_class_name.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def test_class_name @test_class_name end |
#test_file_path ⇒ Object (readonly)
Returns the value of attribute test_file_path.
36 37 38 |
# File 'lib/rails_proof/ai_test_executor.rb', line 36 def test_file_path @test_file_path end |
Instance Method Details
#execute ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/rails_proof/ai_test_executor.rb', line 66 def execute filter = RailsProof::AiConcernFilter.new( concerns: concerns, existing_tests: existing_test_source, review_findings: outstanding_review_findings ) results = filter.concerns.map do |concern| execute_concern(concern) end results.concat( filter.skipped.map do |skipped| skipped_result(skipped) end ) results end |