Class: Tng::Services::TestGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/tng/services/test_generator.rb

Constant Summary collapse

GENERATE_TESTS_PATH =
"cli/tng_rails/contents/generate_tests"
CONTENT_RESPONSES_PATH =
"cli/tng_rails/content_responses"
POLL_INTERVAL_SECONDS =

Poll every 5 seconds

5
MAX_POLL_DURATION_SECONDS =

7 minutes total

420

Instance Method Summary collapse

Constructor Details

#initialize(http_client) ⇒ TestGenerator

Returns a new instance of TestGenerator.



17
18
19
20
21
# File 'lib/tng/services/test_generator.rb', line 17

def initialize(http_client)
  @http_client = http_client
  @machine_info = Tng.machine_info
  @pastel = Pastel.new
end

Instance Method Details

#run_for_controller_method(controller, method_info) ⇒ Object



23
24
25
# File 'lib/tng/services/test_generator.rb', line 23

def run_for_controller_method(controller, method_info)
  generate_test_for_type(controller, method_info, :controller)
end

#run_for_model_method(model, method_info) ⇒ Object



27
28
29
# File 'lib/tng/services/test_generator.rb', line 27

def run_for_model_method(model, method_info)
  generate_test_for_type(model, method_info, :model)
end

#run_for_other_method(other_file, method_info) ⇒ Object



35
36
37
# File 'lib/tng/services/test_generator.rb', line 35

def run_for_other_method(other_file, method_info)
  generate_test_for_type(other_file, method_info, :other)
end

#run_for_service_method(service, method_info) ⇒ Object



31
32
33
# File 'lib/tng/services/test_generator.rb', line 31

def run_for_service_method(service, method_info)
  generate_test_for_type(service, method_info, :service)
end