testrail-ruby 0.0.15 → 0.0.16

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/endpoints.rb +195 -142
  3. data/lib/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f56769ff1aeaa9a6d2e8e832d274875329a36ffa
4
- data.tar.gz: cd15ee3536832d8cce5bf93f2b4c7eb039dbe217
3
+ metadata.gz: 290a3928c5e9715fffec5f817ed4535672ec0094
4
+ data.tar.gz: 7692c400ebd88ca306fc773f3bfcfa461b079103
5
5
  SHA512:
6
- metadata.gz: 8fd7dc7ff512b8a8d90d7733f2d26b9768ac25ca931a6e959e9517a4bed3739fbb5bd336210587e76e1ea8f914b67d0ec5d07b577fa010fc8405b5d5b4722ba4
7
- data.tar.gz: b8e582103d853efb2d5f391e3fe3f670f84284b17a4c82fbcc13f8b08cb3b9652790c2b3e6ede6e393e98188b86abb433dfcff89d981bfb54cdce676baa56e18
6
+ metadata.gz: 3bb482da53163beb434a55f1b3a391219e10e015984e74678e5bbf303714a62eb177fb641a68ff129b4241144b883fb6abd0819df8c423f16dbc355566d757ce
7
+ data.tar.gz: ae0380d34631fad8d68c85f537196559a8b95e46bc336cf9707537aa2cabd6b855c03c6f8b29785ad89e6d7a7cedfc911abc86c2be44842691c9156832595a29
data/lib/endpoints.rb CHANGED
@@ -1,128 +1,142 @@
1
1
  module Endpoints
2
2
  # Returns an existing test case
3
3
  # @param case_id [int] The id of the test case you want.
4
- # @param opts [hash]
5
- # @example GET index.php?/api/v2/get_case/:case_id
4
+ # @param [Hash] opts
5
+ # @example Endpoint
6
+ # index.php?/api/v2/get_case/:case_id
6
7
  # @see http://docs.gurock.com/testrail-api2/reference-cases
7
8
  def get_case(case_id, opts = {})
8
- send_get("get_case/#{case_id.to_s}", opts)
9
+ send_get("get_case/:#{case_id.to_s}", opts)
9
10
  end
10
11
 
11
12
  # Returns a list of test cases for a test suite or specific section in a test suite.
12
13
  # @param project_id [int] The id of the project that contains your tests
13
- # @param opts [hash]
14
- # @example GET index.php?/api/v2/get_cases/:project_id
14
+ # @param [Hash] opts
15
+ # @example Endpoint
16
+ # index.php?/api/v2/get_cases/:project_id
15
17
  # @see http://docs.gurock.com/testrail-api2/reference-cases
16
18
  def get_cases(project_id, opts = {})
17
- send_get("get_cases/#{project_id.to_s}", opts)
19
+ send_get("get_cases/:#{project_id.to_s}", opts)
18
20
  end
19
21
 
20
22
  # Return all test cases in a given project by suite_id and section_id
21
23
  # @param project_id [int] The id of the project that contains your tests
22
24
  # @param suite_id [int] The id of the suite within the project
23
25
  # @param section_id [int] The id of the section within the suite
24
- # @param opts [hash]
25
- # @example GET index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id&section_id=:section_id
26
+ # @param [Hash] opts
27
+ # @example Endpoint
28
+ # index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id&section_id=:section_id
26
29
  # @see http://docs.gurock.com/testrail-api2/reference-cases
27
30
  def get_cases_by_section(project_id, suite_id, section_id, opts = {})
28
- send_get("get_cases/#{project_id.to_s}&suite_id=#{suite_id.to_s}&section_id=#{section_id.to_s}", opts)
31
+ send_get("get_cases/:#{project_id.to_s}&suite_id=:#{suite_id.to_s}&section_id=:#{section_id.to_s}", opts)
29
32
  end
30
33
 
31
34
  # Return all test cases in a given project by suite_id
32
35
  # @param project_id [int] The id of the project that contains your tests
33
36
  # @param suite_id [int] The id of the suite within the project
34
- # @param opts [hash]
35
- # @example GET index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id
37
+ # @param [Hash] opts
38
+ # @example Endpoint
39
+ # index.php?/api/v2/get_cases/:project_id&suite_id=:suite_id
36
40
  # @see http://docs.gurock.com/testrail-api2/reference-cases
37
41
  def get_cases_by_suite(project_id, suite_id, opts = {})
38
- send_get("get_cases/#{project_id.to_s}&suite_id=#{suite_id.to_s}", opts)
42
+ send_get("get_cases/:#{project_id.to_s}&suite_id=:#{suite_id.to_s}", opts)
39
43
  end
40
44
 
41
45
  # Creates a new test case
42
46
  # @param section_id [int] The id of the test case
43
- # @param opts [hash]
44
- # @example POST index.php?/api/v2/add_case/:section_id
47
+ # @param [Hash] opts
48
+ # @example Endpoint
49
+ # index.php?/api/v2/add_case/:section_id
45
50
  # @see http://docs.gurock.com/testrail-api2/reference-cases
46
51
  def add_case(section_id, opts = {})
47
- send_post("add_case/#{section_id.to_s}", opts)
52
+ send_post("add_case/:#{section_id.to_s}", opts)
48
53
  end
49
54
 
50
55
  # Update test result by case id
51
56
  # @param case_id [int] The id of the test case
52
- # @param opts [hash]
53
- # @example POST index.php?/api/v2/update_case/:case_id
57
+ # @param [Hash] opts
58
+ # @example Endpoint
59
+ # index.php?/api/v2/update_case/:case_id
54
60
  # @see http://docs.gurock.com/testrail-api2/reference-cases
55
61
  def update_case(case_id, opts = {})
56
- send_post("update_case/#{case_id.to_s}", opts)
62
+ send_post("update_case/:#{case_id.to_s}", opts)
57
63
  end
58
64
 
59
65
  # Delete test case by case id
60
66
  # @param case_id [int] The id of the test case
61
- # @param opts [hash]
62
- # @example POST index.php?/api/v2/delete_case/:case_id
67
+ # @param [Hash] opts
68
+ # @example Endpoint
69
+ # index.php?/api/v2/delete_case/:case_id
63
70
  # @see http://docs.gurock.com/testrail-api2/reference-cases
64
71
  def delete_case(case_id, opts = {})
65
- send_post("delete_case/#{case_id.to_s}", opts)
72
+ send_post("delete_case/:#{case_id.to_s}", opts)
66
73
  end
67
74
 
68
75
  # Return suite by suite id
69
76
  # @param suite_id [int] The suite id
70
- # @param opts [hash]
71
- # @example GET index.php?/api/v2/get_suite/:suite_id
77
+ # @param [Hash] opts
78
+ # @example Endpoint
79
+ # index.php?/api/v2/get_suite/:suite_id
72
80
  # @see http://docs.gurock.com/testrail-api2/reference-suites
73
81
  def get_suite(suite_id, opts = {})
74
- send_get("get_suite/#{suite_id.to_s}", opts)
82
+ send_get("get_suite/:#{suite_id.to_s}", opts)
75
83
  end
76
84
 
77
85
  # Return all suites in project by project id
78
86
  # @param project_id [int] The id of the project containing suites
79
- # @param opts [hash]
80
- # @example GET index.php?/api/v2/get_suites/:project_id
87
+ # @param [Hash] opts
88
+ # @example Endpoint
89
+ # index.php?/api/v2/get_suites/:project_id
81
90
  # @see http://docs.gurock.com/testrail-api2/reference-suites
82
91
  def get_suites(project_id, opts = {})
83
- send_get("get_suites/#{project_id.to_s}", opts)
92
+ send_get("get_suites/:#{project_id.to_s}", opts)
84
93
  end
85
94
 
86
95
  # Add a test suite
87
96
  # @param project_id [int] The id of the project containing suites
88
- # @param opts [hash]
89
- # @example POST index.php?/api/v2/add_suite/:project_id
97
+ # @param [Hash] opts
98
+ # @example Endpoint
99
+ # index.php?/api/v2/add_suite/:project_id
90
100
  # @see http://docs.gurock.com/testrail-api2/reference-suites
91
101
  def add_suite(project_id, opts = {})
92
- send_post("add_suite/#{project_id.to_s}", opts)
102
+ send_post("add_suite/:#{project_id.to_s}", opts)
93
103
  end
94
104
 
95
105
  # update a test suite
96
106
  # @param suite_id [int] The suite id
97
- # @param opts [hash]
98
- # @example POST index.php?/api/v2/update_suite/:suite_id
107
+ # @param [Hash] opts
108
+ # @example Endpoint
109
+ # index.php?/api/v2/update_suite/:suite_id
99
110
  # @see http://docs.gurock.com/testrail-api2/reference-suites
100
111
  def update_suite(suite_id, opts = {})
101
- send_post("update_suite/#{suite_id.to_s}", opts)
112
+ send_post("update_suite/:#{suite_id.to_s}", opts)
102
113
  end
103
114
 
104
115
  # Delete a test suite
105
116
  # @param suite_id [int] The suite id
106
- # @param opts [hash]
107
- # @example POST index.php?/api/v2/delete_suite/:suite_id
117
+ # @param [Hash] opts
118
+ # @example Endpoint
119
+ # index.php?/api/v2/delete_suite/:suite_id
108
120
  # @see http://docs.gurock.com/testrail-api2/reference-suites
109
121
  def delete_suite(suite_id, opts = {})
110
- send_post("delete_suite/#{suite_id.to_s}", opts)
122
+ send_post("delete_suite/:#{suite_id.to_s}", opts)
111
123
  end
112
124
 
113
125
  # Return section by id
114
126
  # @param section_id [int]
115
- # @param opts [hash]
116
- # @example GET index.php?/api/v2/get_section/:section_id
127
+ # @param [Hash] opts
128
+ # @example Endpoint
129
+ # index.php?/api/v2/get_section/:section_id
117
130
  # @see http://docs.gurock.com/testrail-api2/reference-sections
118
131
  def get_section(section_id, opts = {})
119
- send_get("get_section/#{section_id.to_s}", opts)
132
+ send_get("get_section/:#{section_id.to_s}", opts)
120
133
  end
121
134
 
122
135
  # Get sections for suite
123
136
  # @param suite_id [int]
124
- # @param opts [hash]
125
- # @example GET index.php?/api/v2/get_sections/:project_id&suite_id=:suite_id
137
+ # @param [Hash] opts
138
+ # @example Endpoint
139
+ # index.php?/api/v2/get_sections/:project_id&suite_id=:suite_id
126
140
  # @see http://docs.gurock.com/testrail-api2/reference-sections
127
141
  def get_sections(project_id, suite_id, opts = {})
128
142
  send_get("get_sections/#{project_id.to_s}&suite_id=#{suite_id.to_s}", opts)
@@ -130,154 +144,176 @@ module Endpoints
130
144
 
131
145
  # Add section to suite
132
146
  # @param project_id [int]
133
- # @param opts [hash]
134
- # @example POST index.php?/api/v2/add_section/:project_id
147
+ # @param [Hash] opts
148
+ # @option opts [Int] suite_id
149
+ # @option opts [String] name
150
+ # @option opts [Int] parent_id
151
+ # @example Endpoint
152
+ # index.php?/api/v2/add_section/:project_id
153
+ # @example Code
154
+ # @client.add_section(1, {"suite_id": 5, "name": "This is a new section", "parent_id": 10})
135
155
  # @see http://docs.gurock.com/testrail-api2/reference-sections
136
- # @note suite_id is required unless running in single suite mode
137
- def add_section(project_id, suite_id, opts = {})
138
- send_post("add_section/#{project_id.to_s}&suite_id=#{suite_id.to_s}", opts)
156
+ def add_section(project_id, opts = {})
157
+ send_post("add_section/#{project_id.to_s}", opts)
139
158
  end
140
159
 
141
160
  # Get milestone by milestone id
142
161
  # @param milestone_id [int]
143
- # @param opts [hash]
144
- # @example GET index.php?/api/v2/get_milestone/:milestone_id
162
+ # @param [Hash] opts
163
+ # @example Endpoint
164
+ # index.php?/api/v2/get_milestone/:milestone_id
145
165
  # @see http://docs.gurock.com/testrail-api2/reference-milestones
146
166
  def get_milestone(milestone_id, opts = {})
147
- send_get("get_milestone/#{milestone_id.to_s}", opts)
167
+ send_get("get_milestone/:#{milestone_id.to_s}", opts)
148
168
  end
149
169
 
150
170
  # Get project milestones by project id
151
171
  # @param project_id [int]
152
- # @param opts [hash]
153
- # @example GET index.php?/api/v2/get_milestones/:project_id
172
+ # @param [Hash] opts
173
+ # @example Endpoint
174
+ # index.php?/api/v2/get_milestones/:project_id
154
175
  # @see http://docs.gurock.com/testrail-api2/reference-milestones
155
176
  def get_milestones(project_id, opts = {})
156
- send_get("get_milestones/#{project_id.to_s}", opts)
177
+ send_get("get_milestones/:#{project_id.to_s}", opts)
157
178
  end
158
179
 
159
180
  # Add milestone to project id
160
181
  # @param project_id [int]
161
- # @param opts [hash]
162
- # @example POST index.php?/api/v2/add_milestone/:project_id
182
+ # @param [Hash] opts
183
+ # @example Endpoint
184
+ # index.php?/api/v2/add_milestone/:project_id
163
185
  # @see http://docs.gurock.com/testrail-api2/reference-milestones
164
186
  def add_milestone(project_id, opts = {})
165
- send_post("add_milestone/#{project_id.to_s}", opts)
187
+ send_post("add_milestone/:#{project_id.to_s}", opts)
166
188
  end
167
189
 
168
190
  # Add milestone to project id
169
191
  # @param milestone_id [int]
170
- # @param opts [hash]
171
- # @example POST index.php?/api/v2/update_milestone/:milestone_id
192
+ # @param [Hash] opts
193
+ # @example Endpoint
194
+ # index.php?/api/v2/update_milestone/:milestone_id
172
195
  # @see http://docs.gurock.com/testrail-api2/reference-milestones
173
196
  def update_milestone(milestone_id, opts = {})
174
- send_post("update_milestone/#{milestone_id.to_s}", opts)
197
+ send_post("update_milestone/:#{milestone_id.to_s}", opts)
175
198
  end
176
199
 
177
200
  # Add milestone to project id
178
201
  # @param milestone_id [int]
179
- # @param opts [hash]
180
- # @example POST index.php?/api/v2/delete_milestone/:milestone_id
202
+ # @param [Hash] opts
203
+ # @example Endpoint
204
+ # index.php?/api/v2/delete_milestone/:milestone_id
181
205
  # @see http://docs.gurock.com/testrail-api2/reference-milestones
182
206
  def delete_milestone(milestone_id, opts = {})
183
- send_post("delete_milestone/#{milestone_id.to_s}", opts)
207
+ send_post("delete_milestone/:#{milestone_id.to_s}", opts)
184
208
  end
185
209
 
186
210
  # Get plan by id
187
211
  # @param plan_id [int]
188
- # @param opts [hash]
189
- # @example GET index.php?/api/v2/get_plan/:plan_id
212
+ # @param [Hash] opts
213
+ # @example Endpoint
214
+ # index.php?/api/v2/get_plan/:plan_id
190
215
  # @see http://docs.gurock.com/testrail-api2/reference-plans
191
216
  def get_plan(plan_id, opts = {})
192
- send_get("get_plan/#{plan_id.to_s}", opts)
217
+ send_get("get_plan/:#{plan_id.to_s}", opts)
193
218
  end
194
219
 
195
220
  # Get plans in project by project id
196
221
  # @param project_id [int]
197
- # @param opts [hash]
198
- # @example GET index.php?/api/v2/get_plans/:project_id
222
+ # @param [Hash] opts
223
+ # @example Endpoint
224
+ # index.php?/api/v2/get_plans/:project_id
199
225
  # @see http://docs.gurock.com/testrail-api2/reference-plans
200
226
  def get_plans(project_id, opts = {})
201
- send_get("get_plans/#{project_id.to_s}", opts)
227
+ send_get("get_plans/:#{project_id.to_s}", opts)
202
228
  end
203
229
 
204
230
  # Add plan to project by project id
205
231
  # @param project_id [int]
206
- # @param opts [hash]
207
- # @example POST index.php?/api/v2/add_plan/:project_id
232
+ # @param [Hash] opts
233
+ # @example Endpoint
234
+ # index.php?/api/v2/add_plan/:project_id
208
235
  # @see http://docs.gurock.com/testrail-api2/reference-plans
209
236
  def add_plan(project_id, opts = {})
210
- send_post("add_plan/#{project_id.to_s}", opts)
237
+ send_post("add_plan/:#{project_id.to_s}", opts)
211
238
  end
212
239
 
213
240
  # Add plan entries by plan id
214
241
  # @param plan_id [int]
215
- # @param opts [hash]
216
- # @example POST index.php?/api/v2/add_plan_entry/:plan_id
242
+ # @param [Hash] opts
243
+ # @example Endpoint
244
+ # index.php?/api/v2/add_plan_entry/:plan_id
217
245
  # @see http://docs.gurock.com/testrail-api2/reference-plans
218
246
  def add_plan_entry(plan_id, opts = {})
219
- send_post("add_plan_entry/#{plan_id.to_s}", opts)
247
+ send_post("add_plan_entry/:#{plan_id.to_s}", opts)
220
248
  end
221
249
 
222
250
  # Update plan by plan id
223
251
  # @param plan_id [int]
224
- # @param opts [hash]
225
- # @example POST index.php?/api/v2/update_plan/:plan_id
252
+ # @param [Hash] opts
253
+ # @example Endpoint
254
+ # index.php?/api/v2/update_plan/:plan_id
226
255
  # @see http://docs.gurock.com/testrail-api2/reference-plans
227
256
  def update_plan(plan_id, opts = {})
228
- send_post("update_plan/#{plan_id.to_s}", opts)
257
+ send_post("update_plan/:#{plan_id.to_s}", opts)
229
258
  end
230
259
 
231
260
  # Update plan entry by plan id
232
261
  # @param plan_id [int]
233
262
  # @param entry_id [int] Id of entry
234
- # @param opts [hash]
235
- # @example POST index.php?/api/v2/update_plan_entry/:plan_id/:entry_id
263
+ # @param [Hash] opts
264
+ # @example Endpoint
265
+ # index.php?/api/v2/update_plan_entry/:plan_id/:entry_id
236
266
  # @see http://docs.gurock.com/testrail-api2/reference-plans
237
267
  def update_plan_entry(plan_id, entry_id, opts = {})
238
- send_post("update_plan_entry/#{plan_id.to_s}/#{entry_id.to_s}", opts)
268
+ send_post("update_plan_entry/:#{plan_id.to_s}/:#{entry_id.to_s}", opts)
239
269
  end
240
270
 
241
271
  # Close plan by plan id
242
272
  # @param plan_id [int]
243
- # @param opts [hash]
244
- # @example POST index.php?/api/v2/close_plan/:plan_id
273
+ # @param [Hash] opts
274
+ # @example Endpoint
275
+ # index.php?/api/v2/close_plan/:plan_id
245
276
  # @see http://docs.gurock.com/testrail-api2/reference-plans
246
277
  def close_plan(plan_id, opts = {})
247
- send_post("close_plan/#{plan_id.to_s}", opts)
278
+ send_post("close_plan/:#{plan_id.to_s}", opts)
248
279
  end
249
280
 
250
- # @example POST index.php?/api/v2/delete_plan/:plan_id
281
+ # @example Endpoint
282
+ # index.php?/api/v2/delete_plan/:plan_id
251
283
  # @see http://docs.gurock.com/testrail-api2/reference-plans
252
284
  def delete_plan(plan_id, opts)
253
- send_post("delete_plan/#{plan_id.to_s}", opts)
285
+ send_post("delete_plan/:#{plan_id.to_s}", opts)
254
286
  end
255
287
 
256
- # @example POST index.php?/api/v2/delete_plan_entry/:plan_id/:entry_id
288
+ # @example Endpoint
289
+ # index.php?/api/v2/delete_plan_entry/:plan_id/:entry_id
257
290
  def delete_plan_entry(plan_id, entry_id, opts = {})
258
- send_post("delete_plan_entry/#{plan_id.to_s}/#{entry_id.to_s}", opts)
291
+ send_post("delete_plan_entry/:#{plan_id.to_s}/:#{entry_id.to_s}", opts)
259
292
  end
260
293
 
261
294
  # Get project by project id
262
295
  # @param project_id [int]
263
- # @param opts [hash]
264
- # @example GET index.php?/api/v2/get_project/:project_id
296
+ # @param [Hash] opts
297
+ # @example Endpoint
298
+ # index.php?/api/v2/get_project/:project_id
265
299
  # @see http://docs.gurock.com/testrail-api2/reference-projects
266
300
  def get_project(project_id, opts = {})
267
- send_get("get_project/#{project_id.to_s}", opts)
301
+ send_get("get_project/:#{project_id.to_s}", opts)
268
302
  end
269
303
 
270
304
  # Get all projects
271
- # @param opts [hash]
272
- # @example GET index.php?/api/v2/get_projects
305
+ # @param [Hash] opts
306
+ # @example Endpoint
307
+ # index.php?/api/v2/get_projects
273
308
  # @see http://docs.gurock.com/testrail-api2/reference-projects
274
309
  def get_projects(opts = {})
275
310
  send_get('get_projects', opts)
276
311
  end
277
312
 
278
313
  # Add a project
279
- # @param opts [hash]
280
- # @example POST index.php?/api/v2/add_project
314
+ # @param [Hash] opts
315
+ # @example Endpoint
316
+ # index.php?/api/v2/add_project
281
317
  # @see http://docs.gurock.com/testrail-api2/reference-projects
282
318
  def add_project(opts = {})
283
319
  send_post("add_project", opts)
@@ -285,102 +321,113 @@ module Endpoints
285
321
 
286
322
  # Update a project
287
323
  # @param project_id [int] The project you want to update
288
- # @param opts [hash]
289
- # @example POST index.php?/api/v2/update_project/:project_id
324
+ # @param [Hash] opts
325
+ # @example Endpoint
326
+ # index.php?/api/v2/update_project/:project_id
290
327
  # @see http://docs.gurock.com/testrail-api2/reference-projects
291
328
  def update_project(project_id, opts)
292
- send_post("update_project/#{project_id.to_s}", opts)
329
+ send_post("update_project/:#{project_id.to_s}", opts)
293
330
  end
294
331
 
295
332
 
296
333
  # Delete a project
297
334
  # @param project_id [int] The project you want to delete
298
- # @param opts [hash]
299
- # @example POST index.php?/api/v2/delete_project/:project_id
335
+ # @param [Hash] opts
336
+ # @example Endpoint
337
+ # index.php?/api/v2/delete_project/:project_id
300
338
  # @see http://docs.gurock.com/testrail-api2/reference-projects
301
339
  def delete_project(project_id, opts)
302
- send_post("delete_project/#{project_id.to_s}", opts)
340
+ send_post("delete_project/:#{project_id.to_s}", opts)
303
341
  end
304
342
 
305
343
  # Returns a list of test results for a test
306
344
  # @param test_id [int]
307
- # @param opts [hash]
308
- # @example GET index.php?/api/v2/get_results/:test_id
345
+ # @param [Hash] opts
346
+ # @example Endpoint
347
+ # index.php?/api/v2/get_results/:test_id
309
348
  # @see http://docs.gurock.com/testrail-api2/reference-results
310
349
  def get_results(test_id, opts = {})
311
- send_get("get_results/#{test_id.to_s}", opts)
350
+ send_get("get_results/:#{test_id.to_s}", opts)
312
351
  end
313
352
 
314
353
  # Returns a list of test results for a test run and case combination
315
354
  # @param run_id [int]
316
355
  # @param case_id [int]
317
- # @param opts [hash]
318
- # @example GET index.php?/api/v2/get_results_for_case/:run_id/:case_id
356
+ # @param [Hash] opts
357
+ # @example Endpoint
358
+ # index.php?/api/v2/get_results_for_case/:run_id/:case_id
319
359
  # @see http://docs.gurock.com/testrail-api2/reference-results
320
360
  def get_results_for_case(run_id, case_id, opts = {})
321
- send_get("get_results_for_case/#{run_id.to_s}/#{case_id.to_s}", opts)
361
+ send_get("get_results_for_case/:#{run_id.to_s}/:#{case_id.to_s}", opts)
322
362
  end
323
363
 
324
364
  # Returns a list of test results for a test run
325
365
  # @param run_id [int]
326
- # @param opts [hash]
327
- # @example GET index.php?/api/v2/get_results_for_run/:run_id
366
+ # @param [Hash] opts
367
+ # @example Endpoint
368
+ # index.php?/api/v2/get_results_for_run/:run_id
328
369
  # @see http://docs.gurock.com/testrail-api2/reference-results
329
370
  def get_results_for_run(run_id, opts = {})
330
- send_get("get_results_for_run/#{run_id.to_s}", opts)
371
+ send_get("get_results_for_run/:#{run_id.to_s}", opts)
331
372
  end
332
373
 
333
374
  # Adds a new test result, comment or assigns a test. It's recommended to use add_results instead if you plan to add results for multiple tests.
334
375
  # @param test_id [int]
335
- # @param opts [hash]
336
- # @example POST index.php?/api/v2/add_result/:test_id
376
+ # @param [Hash] opts
377
+ # @example Endpoint
378
+ # index.php?/api/v2/add_result/:test_id
337
379
  # @see http://docs.gurock.com/testrail-api2/reference-results
338
380
  def add_result(test_id, opts = {})
339
- send_post("add_result/#{test_id.to_s}", opts)
381
+ send_post("add_result/:#{test_id.to_s}", opts)
340
382
  end
341
383
 
342
384
  # Adds a new test result, comment or assigns a test (for a test run and case combination)
343
385
  # @param run_id [int]
344
386
  # @param case_id [int]
345
- # @param opts [hash]
346
- # @example POST index.php?/api/v2/add_result_for_case/:run_id/:case_id
387
+ # @param [Hash] opts
388
+ # @example Endpoint
389
+ # index.php?/api/v2/add_result_for_case/:run_id/:case_id
347
390
  # @see http://docs.gurock.com/testrail-api2/reference-results
348
391
  def add_result_for_case(run_id, case_id, opts = {})
349
- send_post("add_result_for_case/#{run_id.to_s}/#{case_id.to_s}", opts)
392
+ send_post("add_result_for_case/:#{run_id.to_s}/:#{case_id.to_s}", opts)
350
393
  end
351
394
 
352
395
  # Adds one or more new test results, comments or assigns one or more tests
353
396
  # @param run_id [int]
354
- # @param opts [hash]
355
- # @example POST index.php?/api/v2/add_results/:run_id
397
+ # @param [Hash] opts
398
+ # @example Endpoint
399
+ # index.php?/api/v2/add_results/:run_id
356
400
  # @see http://docs.gurock.com/testrail-api2/reference-results
357
401
  def add_results(run_id, opts = {})
358
- send_post("add_results/#{run_id.to_s}", opts)
402
+ send_post("add_results/:#{run_id.to_s}", opts)
359
403
  end
360
404
 
361
405
  # Adds one or more new test results, comments or assigns one or more tests (using the case IDs)
362
406
  # @param run_id [int]
363
- # @param opts [hash]
364
- # @example POST index.php?/api/v2/add_results_for_cases/:run_id
407
+ # @param [Hash] opts
408
+ # @example Endpoint
409
+ # index.php?/api/v2/add_results_for_cases/:run_id
365
410
  # @see http://docs.gurock.com/testrail-api2/reference-results
366
411
  def add_results_for_cases(run_id, opts = {})
367
- send_post("add_results_for_cases/#{run_id.to_s}", opts)
412
+ send_post("add_results_for_cases/:#{run_id.to_s}", opts)
368
413
  end
369
414
 
370
415
  # Get run by run id
371
416
  # @param run_id [int]
372
- # @param opts [hash]
373
- # @example GET index.php?/api/v2/get_run/:run_id
417
+ # @param [Hash] opts
418
+ # @example Endpoint
419
+ # index.php?/api/v2/get_run/:run_id
374
420
  # @see http://docs.gurock.com/testrail-api2/reference-runs
375
421
  def get_run(run_id, opts = {})
376
- send_get("get_run/#{run_id.to_s}", opts)
422
+ send_get("get_run/:#{run_id.to_s}", opts)
377
423
  end
378
424
 
379
425
  # Get runs by project id
380
426
  # @param project_id [int]
381
427
  # @param plan_id [int]
382
- # @param opts [hash]
383
- # @example GET index.php?/api/v2/get_runs/:project_id
428
+ # @param [Hash] opts
429
+ # @example Endpoint
430
+ # index.php?/api/v2/get_runs/:project_id
384
431
  # @see http://docs.gurock.com/testrail-api2/reference-runs
385
432
  def get_runs(project_id, opts = {})
386
433
  send_get("get_runs/#{project_id.to_s}", opts)
@@ -388,26 +435,29 @@ module Endpoints
388
435
 
389
436
  # Add run by suite id
390
437
  # @param project_id [int]
391
- # @param opts [hash]
392
- # @example POST index.php?/api/v2/add_run/:project_id
438
+ # @param [Hash] opts
439
+ # @example Endpoint
440
+ # index.php?/api/v2/add_run/:project_id
393
441
  # @see http://docs.gurock.com/testrail-api2/reference-runs
394
442
  def add_run(project_id, opts = {})
395
- send_post("add_run/#{project_id.to_s}", opts)
443
+ send_post("add_run/:#{project_id.to_s}", opts)
396
444
  end
397
445
 
398
446
  # Updates existing test run
399
447
  # @param run_id [int]
400
- # @param opts [hash]
401
- # @example POST index.php?/api/v2/update_run/:run_id
448
+ # @param [Hash] opts
449
+ # @example Endpoint
450
+ # index.php?/api/v2/update_run/:run_id
402
451
  # @see http://docs.gurock.com/testrail-api2/reference-runs
403
452
  def update_run(run_id, opts = {})
404
- send_post("update_run/#{run_id.to_s}", opts)
453
+ send_post("update_run/:#{run_id.to_s}", opts)
405
454
  end
406
455
 
407
456
  # Closes an existing test run and archives its tests & results
408
457
  # @param run_id [int]
409
- # @param opts [hash]
410
- # @example POST index.php?/api/v2/close_run/:run_id
458
+ # @param [Hash] opts
459
+ # @example Endpoint
460
+ # index.php?/api/v2/close_run/:run_id
411
461
  # @see http://docs.gurock.com/testrail-api2/reference-runs
412
462
  def close_run(run_id, opts = {})
413
463
  send_post("close_run/#{run_id.to_s}", opts)
@@ -415,29 +465,32 @@ module Endpoints
415
465
 
416
466
  # Deletes an existing test run.
417
467
  # @param run_id [int]
418
- # @param opts [hash]
419
- # @example POST index.php?/api/v2/delete_run/:run_id
468
+ # @param [Hash] opts
469
+ # @example Endpoint
470
+ # index.php?/api/v2/delete_run/:run_id
420
471
  # @see http://docs.gurock.com/testrail-api2/reference-runs
421
472
  def delete_run(run_id, opts = {})
422
- send_post("delete_run/#{run_id.to_s}", opts)
473
+ send_post("delete_run/:#{run_id.to_s}", opts)
423
474
  end
424
475
 
425
476
  # Returns an existing test
426
477
  # @param test_id [int]
427
- # @param opts [hash]
428
- # @example GET index.php?/api/v2/get_test/:test_id
478
+ # @param [Hash] opts
479
+ # @example Endpoint
480
+ # index.php?/api/v2/get_test/:test_id
429
481
  # @see http://docs.gurock.com/testrail-api2/reference-tests
430
482
  def get_test(test_id, opts = {})
431
- send_get("get_test/#{test_id.to_s}", opts)
483
+ send_get("get_test/:#{test_id.to_s}", opts)
432
484
  end
433
485
 
434
486
  # Returns a list of tests for a test run
435
487
  # @param run_id [int]
436
- # @param opts [hash]
437
- # @example GET index.php?/api/v2/get_tests/:run_id
488
+ # @param [Hash] opts
489
+ # @example Endpoint
490
+ # index.php?/api/v2/get_tests/:run_id
438
491
  # @see http://docs.gurock.com/testrail-api2/reference-tests
439
492
  def get_tests(run_id, opts = {})
440
- send_get("get_tests/#{run_id.to_s}", opts)
493
+ send_get("get_tests/:#{run_id.to_s}", opts)
441
494
  end
442
495
 
443
496
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Testrail
2
- VERSION = '0.0.15'.freeze
2
+ VERSION = '0.0.16'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrail-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frances Morales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler