kanoah_ruby 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0686053030f7716f58bae76f1d2d07d0719cf72
4
- data.tar.gz: 4e5309bcb00237b447d53806d968b18ce8e37f14
3
+ metadata.gz: 111d9543e2f245eb921c5ea4c9bf7e59d21ae298
4
+ data.tar.gz: 118440477cd2b9006a56494684678dcfc4689bb4
5
5
  SHA512:
6
- metadata.gz: cd1804d734ca7d5466d0b16559f8ac185ad47ece89a29ae8c5abf0b7b46331bffdd32fee07b16fbd8bd088675e9eb8b9a9b943db38cac79a739e608940c78501
7
- data.tar.gz: f1491b4a354d31844fe80593247baaea6efc3a82d67f780754a74007bf304ab17263cd7d294b387009e30c1d1bfc0e1c5f514e8336211123c3643b35c92c34af
6
+ metadata.gz: 2257cc609062ad855249c1936f5a031825a601dc95a68f3d89bd5b7a6c3e12213d7f122f6c2c23a51c6b41d95374f1d6ce2e380baf9acd6a2a7b3829e8bdeab2
7
+ data.tar.gz: 194ad9700c3322e2db4d86d89745b29decf08eb9ed47afd87eb36fcbe505fa2b6939ac83897a8defdf20d6bf5df0dcdcc2f0c61b5afc1c4a40745a6f2fa36806
data/lib/client.rb CHANGED
@@ -9,17 +9,21 @@ module Kanoah
9
9
  include Kanoah::Services::TestResult
10
10
  include Kanoah::Services::TestRun
11
11
 
12
+ include Kanoah::Helper::TestCase
13
+
12
14
  default_options.update(verify: false)
13
15
  format :json
14
- attr_reader :environment, :test_run_id, :project, :response
16
+ attr_reader :test_run_id, :project, :response
15
17
 
16
18
 
17
19
  def initialize(options={})
18
- self.class.base_uri options.fetch(:base_url) { Kanoah.config.base_url }
19
- @environment = options.fetch(:environment)
20
- @test_run_id = options.fetch(:test_run_id) { nil }
21
- @project_id = options.fetch(:project_id)
22
- token = Base64.encode64(options.fetch(:username)+':'+options.fetch(:password))
20
+ self.class.base_uri options.fetch(:base_url) { Kanoah.config.base_url }
21
+ @environment = options.fetch(:environment) { Kanoah.config.base_url }
22
+ @test_run_id = options.fetch(:test_run_id) { Kanoah.config.test_run_id }
23
+ @project_id = options.fetch(:project_id) { Kanoah.config.project_id }
24
+ username = options.fetch(:username) { Kanoah.config.username }
25
+ password = options.fetch(:password) { Kanoah.config.password }
26
+ token = Base64.encode64(username+':'+password)
23
27
  set_access_token(token[0..-2])
24
28
  end
25
29
 
data/lib/configuration.rb CHANGED
@@ -1,20 +1,23 @@
1
1
  module Kanoah
2
+ class << self
3
+ attr_accessor :config
4
+ end
2
5
 
3
- class << self
4
- attr_accessor :config
5
- end
6
-
7
- def self.configure
8
- self.config ||= Configuration.new
9
- yield(config)
10
- end
6
+ def self.configure
7
+ self.config ||= Configuration.new
8
+ yield(config)
9
+ end
11
10
 
12
- class Configuration
13
- attr_accessor :base_url
11
+ class Configuration
12
+ attr_accessor :base_url, :test_run_id, :environment, :username, :password, :project_id
14
13
 
15
- def initialize
16
- @base_url = nil
14
+ def initialize
15
+ @base_url = nil
16
+ @test_run_id = nil
17
+ @project_id = nil
18
+ @environment = nil
19
+ @username = nil
20
+ @password = nil
21
+ end
17
22
  end
18
-
19
23
  end
20
- end
@@ -0,0 +1,11 @@
1
+ module Kanoah
2
+ module Helper
3
+ module TestCase
4
+ def retrive_based_on_username(test_run, username)
5
+ test_run['items'].map do |test_case|
6
+ test_case['testCaseKey'] if test_case['userKey'] == username
7
+ end.compact
8
+ end
9
+ end
10
+ end
11
+ end
data/lib/kanoah_ruby.rb CHANGED
@@ -9,5 +9,6 @@ require_relative 'services/test_case'
9
9
  require_relative 'services/test_plan'
10
10
  require_relative 'services/test_result'
11
11
  require_relative 'services/test_run'
12
+ require_relative 'helpers/test_case'
12
13
 
13
14
  require_relative 'client'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanoah_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Automation Wizards
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -35,6 +35,7 @@ files:
35
35
  - README.md
36
36
  - lib/client.rb
37
37
  - lib/configuration.rb
38
+ - lib/helpers/test_case.rb
38
39
  - lib/kanoah_ruby.rb
39
40
  - lib/services/authentication.rb
40
41
  - lib/services/issue_link.rb