testrail-ruby 0.1.01 → 0.1.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testrail-ruby.rb +5 -16
- data/lib/version.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/testrail/endpoints_spec.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91689469cbfd26e31523f445b334168243e45b96
|
4
|
+
data.tar.gz: 7690d7f75d071b64d71687e8758033fd61d0a0fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6983c9eac327ce7770cb7c9ee178b5d6e9ca2f7f2e7c487b6717c508c71deb6a1163fa1e8131c5fa147a1ab91f34aa74d540ee555970af49e80f794c8247a107
|
7
|
+
data.tar.gz: 28701485d55eebc98ea5112050374512482d154941a9a336497f702c1bd6f03b193785374260bd6ca38bd92339481c2459e58f213b6f55d996f18585a4ec3bb4
|
data/lib/testrail-ruby.rb
CHANGED
@@ -21,6 +21,7 @@ module TestRail
|
|
21
21
|
attr_accessor :user
|
22
22
|
attr_accessor :password
|
23
23
|
|
24
|
+
# :nocov:
|
24
25
|
def initialize(base_url)
|
25
26
|
if !base_url.match(/\/$/)
|
26
27
|
base_url += '/'
|
@@ -28,26 +29,17 @@ module TestRail
|
|
28
29
|
@url = base_url + 'index.php?/api/v2/'
|
29
30
|
end
|
30
31
|
|
32
|
+
# :nocov:
|
31
33
|
def send_get(uri)
|
32
34
|
_send_request('GET', uri)
|
33
35
|
end
|
36
|
+
# :nocov:
|
34
37
|
|
35
|
-
#
|
36
|
-
# Send POST
|
37
|
-
#
|
38
|
-
# Issues a POST request (write) against the API and returns the result
|
39
|
-
# (as Ruby hash).
|
40
|
-
#
|
41
|
-
# Arguments:
|
42
|
-
#
|
43
|
-
# uri The API method to call including parameters
|
44
|
-
# (e.g. add_case/1)
|
45
|
-
# data The data to submit as part of the request (as
|
46
|
-
# Ruby hash, strings must be UTF-8 encoded)
|
47
|
-
#
|
38
|
+
# :nocov:
|
48
39
|
def send_post(uri, data)
|
49
40
|
_send_request('POST', uri, data)
|
50
41
|
end
|
42
|
+
# :nocov:
|
51
43
|
|
52
44
|
private
|
53
45
|
|
@@ -62,7 +54,6 @@ module TestRail
|
|
62
54
|
end
|
63
55
|
request.basic_auth(@user, @password)
|
64
56
|
request.add_field('Content-Type', 'application/json')
|
65
|
-
|
66
57
|
conn = Net::HTTP.new(url.host, url.port)
|
67
58
|
if url.scheme == 'https'
|
68
59
|
conn.use_ssl = true
|
@@ -75,7 +66,6 @@ module TestRail
|
|
75
66
|
else
|
76
67
|
result = {}
|
77
68
|
end
|
78
|
-
|
79
69
|
if response.code != '200'
|
80
70
|
if result && result.key?('error')
|
81
71
|
error = '"' + result['error'] + '"'
|
@@ -85,7 +75,6 @@ module TestRail
|
|
85
75
|
raise APIError.new('TestRail API returned HTTP %s (%s)' %
|
86
76
|
[response.code, error])
|
87
77
|
end
|
88
|
-
|
89
78
|
result
|
90
79
|
end
|
91
80
|
end
|
data/lib/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED