Class: QTest::Client

Inherits:
Object
  • Object
show all
Includes:
REST::API
Defined in:
lib/qtest/client.rb

Constant Summary

Constants included from REST::API

REST::API::BASE_PATH

Instance Attribute Summary

Attributes included from REST::API

#token

Instance Method Summary collapse

Methods included from REST::API

#all, #auth, #create, #fields, included, #move, #unique

Methods included from REST::Module

#module, #modules

Methods included from REST::Utils

#decode_response_body, #delete, #get, #handle_response, #post, #put

Methods included from REST::TestCase

#create_test_case, #test_case, #test_case_version, #test_case_versions, #test_cases, #test_step

Methods included from REST::TestSuite

#create_test_suite, #move_test_suite, #test_suite, #test_suites, #update_test_suite

Methods included from REST::TestRun

#create_test_run, #delete_test_run, #execution_statuses, #move_test_run, #submit_test_log, #test_run, #test_run_fields, #test_runs, #update_test_run

Methods included from REST::TestCycle

#create_test_cycle, #delete_test_cycle, #move_test_cycle, #test_cycle, #test_cycles, #update_test_cycle

Methods included from REST::Release

#release, #releases

Methods included from REST::Project

#project, #projects

Constructor Details

#initialize(_opts = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/qtest/client.rb', line 5

def initialize(_opts = {})
  define_base_client
  define_base_instance_client
end

Instance Method Details

#base_uriString

Get the base URI registered for the Client.

Examples:


client = Client.new.configure do |c|
  c.base_uri = 'http://qtest.mycompany.com'
end

client.base_uri #=> 'http://qtest.mycompany.com'

Returns:

  • (String)


34
35
36
# File 'lib/qtest/client.rb', line 34

def base_uri
  self.class.base_uri
end

#base_uri=(uri) ⇒ Object

Set the base URI for the Client.

Parameters:

  • uri (String)

    host/address



41
42
43
44
# File 'lib/qtest/client.rb', line 41

def base_uri=(uri)
  self.class.send(:base_uri, uri)
  @base_uri = uri
end

#configure {|_self| ... } ⇒ Object

Configure the Client.

## Example

client = Client.new.configure do |c|
  c.base_uri = 'http//qtest.mycompany.com'
end

Yields:

  • (_self)

Yield Parameters:

  • _self (QTest::Client)

    the object that the method was called on



18
19
20
21
# File 'lib/qtest/client.rb', line 18

def configure
  yield self
  self
end