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

Inherits:
BaseCommand show all
Defined in:
lib/superbot/cloud/cli/test/list_command.rb

Instance Method Summary collapse

Methods inherited from LoginRequiredCommand

#run, run

Methods included from Validations

#require_login

Instance Method Details

#executeObject



8
9
10
# File 'lib/superbot/cloud/cli/test/list_command.rb', line 8

def execute
  list_tests
end

#list_testsObject



12
13
14
15
16
17
18
19
20
# File 'lib/superbot/cloud/cli/test/list_command.rb', line 12

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