Class: Kanoah::Client
- Inherits:
-
Object
- Object
- Kanoah::Client
- Includes:
- HTTParty, Services::Authentication, Services::IssueLink, Services::TestCase, Services::TestPlan, Services::TestResult, Services::TestRun
- Defined in:
- lib/client.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#test_run_id ⇒ Object
readonly
Returns the value of attribute test_run_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #set_access_token(token) ⇒ Object
Methods included from Services::TestRun
#get_run_details, #get_test_runs, #post_new_result_to_run, #post_new_test_run, #update_result_of_run
Methods included from Services::TestResult
Methods included from Services::TestPlan
Methods included from Services::TestCase
#get_test_case_details, #post_new_test_case, #search_test_cases
Methods included from Services::IssueLink
Methods included from Services::Authentication
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 |
# File 'lib/client.rb', line 17 def initialize(={}) self.class.base_uri .fetch(:base_url) { Kanoah.config.base_url } @environment = .fetch(:environment) @test_run_id = .fetch(:test_run_id) { nil } @project_id = .fetch(:project_id) token = Base64.encode64(.fetch(:username)+':'+.fetch(:password)) set_access_token(token[0..-2]) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
14 15 16 |
# File 'lib/client.rb', line 14 def environment @environment end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
14 15 16 |
# File 'lib/client.rb', line 14 def project @project end |
#test_run_id ⇒ Object (readonly)
Returns the value of attribute test_run_id.
14 15 16 |
# File 'lib/client.rb', line 14 def test_run_id @test_run_id end |
Instance Method Details
#set_access_token(token) ⇒ Object
26 27 28 |
# File 'lib/client.rb', line 26 def set_access_token(token) @header = { "Authorization" => "Basic #{token}", "Content-Type" => "application/json"} end |