Class: Superbot::CLI::Cloud::Test::ListCommand

Inherits:
Clamp::Command
  • Object
show all
Includes:
Superbot::Cloud::Validations
Defined in:
lib/superbot/cloud/cli/cloud/test/list_command.rb

Instance Method Summary collapse

Methods included from Superbot::Cloud::Validations

#require_login

Instance Method Details

#executeObject



12
13
14
15
# File 'lib/superbot/cloud/cli/cloud/test/list_command.rb', line 12

def execute
  
  list_tests
end

#list_testsObject



17
18
19
20
21
22
23
24
25
# File 'lib/superbot/cloud/cli/cloud/test/list_command.rb', line 17

def list_tests
  api_response = Superbot::Cloud::Api.request(:test_list, params: { organization_name: organization })
  abort api_response[:errors] if api_response[:errors]
  puts "Organization: #{api_response[:organization]}"
  puts "Tests:"
  api_response[:tests].each do |test|
    puts(test[:name], test[:files].map { |f| "- #{f[:filename]}" })
  end
end