Module: TeamCity::Client::Tests

Included in:
TeamCity::Client
Defined in:
lib/teamcity/client/tests.rb

Overview

Defines methods related to tests

Instance Method Summary collapse

Instance Method Details

#tests(options = {}) ⇒ Array<Hashie::Mash>

List of tests

Parameters:

  • options (Hash) (defaults to: {})

    list of test locators to filter test results on

Returns:

  • (Array<Hashie::Mash>)

    of tests (empty array if no tests exist)



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/teamcity/client/tests.rb', line 11

def tests(options={})
  url_params = options.empty? ? '' : "?locator=#{locator(options)}"
  tests = []
  begin
    response = get("testOccurrences#{url_params}")
    tests = response.testOccurrence
  rescue
    tests = []
  end
  tests
end