testrail-ruby 0.0.6 → 0.0.7

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: 2f9caa436fc854b728843bb5107274faaef88e58
4
- data.tar.gz: a62138f2434efeab86cb75e7a06ca5c9c477f54d
3
+ metadata.gz: 7e752f6f2bfe9993b01a164db160f853b8112344
4
+ data.tar.gz: 32d0ffd73f570382c12594d51bfa327536d7c194
5
5
  SHA512:
6
- metadata.gz: 72ed42abf0f6a12ba8fb984e65211e17774c10d33308fd1e3ac3321b7bc37fd0d033c8bba830b33720d0de914a713f181750d24e508dcbb4014070482a4430f8
7
- data.tar.gz: 527363bb473a7059fad7e72e301ab2e0c56a0bc734c847ac46c7ad8d93cc7f7cf508188f5768ba6e230377ed38e6c9b9d56cb5f42bf5ba4c2949bd9a1e2e048a
6
+ metadata.gz: eaa3be02dbbe23ddf73c8512b262d2b06d501d1207ed6fb4caaa180ad1b512369cf4dcb408f6ec99f6898083ff526d72b00492a046473739bfbed05f42830ed4
7
+ data.tar.gz: fcfcab1bc4bd4c5047cb6115652b30f17ad99f28e04658c071491a42c2150b014ffcc6de855f0c4cb4ec9fd5b0d5adad733b0e6382ee7406e3f4ca9e5518ddcc
data/lib/endpoints.rb CHANGED
@@ -1,121 +1,237 @@
1
-
2
- #
3
- # This space left blank intentionally
4
- #
5
1
  module Endpoints
6
- def add_result(test_id, opts = {})
7
- send_post("add_result/#{test_id}", opts)
8
- end
9
-
10
- def add_result_for_case(run_id, case_id, opts = {})
11
- send_post("add_result_for_case/#{run_id}/#{case_id}", opts)
12
- end
13
-
14
- def get_test(test_id, opts = {})
15
- send_get("get_test/#{test_id}", opts)
16
- end
17
-
18
- def get_tests(run_id, opts = {})
19
- send_get("get_tests/#{run_id}", opts)
20
- end
21
-
2
+ # Return a single test case
3
+ # @param case_id [int] The id of the test case you want.
4
+ # @param opts [hash]
5
+ # @see http://docs.gurock.com/testrail-api2/reference-cases
22
6
  def get_case(case_id, opts = {})
23
- send_get("get_case/#{case_id}", opts)
7
+ send_get("get_case/#{case_id.to_s}", opts)
24
8
  end
25
9
 
26
- def get_cases(project_id, suite_id, opts = {})
27
- send_get("get_cases/#{project_id}&suite_id=#{suite_id}", opts)
10
+ # Return all test cases in a given project
11
+ # @param project_id [int] The id of the project that contains your tests
12
+ # @param opts [hash]
13
+ # @see http://docs.gurock.com/testrail-api2/reference-cases
14
+ def get_cases(project_id, opts = {})
15
+ send_get("get_cases/#{project_id.to_s}", opts)
28
16
  end
29
17
 
30
- def add_case(section_id, opts = {})
31
- send_post("add_case/#{section_id}", opts)
18
+ # Add results to a geven test case
19
+ # @param case_id [int] The id of the test case
20
+ # @param opts [hash]
21
+ # @see http://docs.gurock.com/testrail-api2/reference-cases
22
+ def add_case(case_id, opts = {})
23
+ send_post("add_case/#{case_id.to_s}", opts)
32
24
  end
33
25
 
26
+ # Update test result by case id
27
+ # @param case_id [int] The id of the test case
28
+ # @param opts [hash]
29
+ # @see http://docs.gurock.com/testrail-api2/reference-cases
34
30
  def update_case(case_id, opts = {})
35
- send_post("update_case/#{case_id}", opts)
31
+ send_post("update_case/#{case_id.to_s}", opts)
36
32
  end
37
33
 
34
+ # Delete test case by case id
35
+ # @param case_id [int] The id of the test case
36
+ # @param opts [hash]
37
+ # @see http://docs.gurock.com/testrail-api2/reference-cases
38
38
  def delete_case(case_id, opts = {})
39
- send_post("delete_case/#{case_id}", opts)
39
+ send_post("delete_case/#{case_id.to_s}", opts)
40
40
  end
41
41
 
42
+ # Return suite by suite id
43
+ # @param suite_id [int] The suite id
44
+ # @param opts [hash]
45
+ # @see http://docs.gurock.com/testrail-api2/reference-suites
42
46
  def get_suite(suite_id, opts = {})
43
- send_get("get_suite/#{suite_id}", opts)
47
+ send_get("get_suite/#{suite_id.to_s}", opts)
44
48
  end
45
49
 
50
+ # Return all suites in project by project id
51
+ # @param project_id [int] The id of the project containing suites
52
+ # @param opts [hash]
53
+ # @see http://docs.gurock.com/testrail-api2/reference-suites
46
54
  def get_suites(project_id, opts = {})
47
- send_get("get_suites/#{project_id}", opts)
55
+ send_get("get_suites/#{project_id.to_s}", opts)
48
56
  end
49
57
 
50
- def get_section(section_id, opts = {})
51
- send_get("get_section/#{section_id}", opts)
58
+ # Add a test suite
59
+ # @param project_id [int] The id of the project containing suites
60
+ # @param opts [hash]
61
+ # @see http://docs.gurock.com/testrail-api2/reference-suites
62
+ def add_suite(project_id, opts = {})
63
+ send_post("add_suite/#{project_id.to_s}", opts)
52
64
  end
53
65
 
54
- def get_sections(suite_id, opts = {})
55
- send_get("get_sections/#{suite_id}", opts)
66
+ # Return section by id
67
+ # @param section_id [int]
68
+ # @param opts [hash]
69
+ # @see http://docs.gurock.com/testrail-api2/reference-sections
70
+ def get_section(section_id, opts = {})
71
+ send_get("get_section/#{section_id.to_s}", opts)
56
72
  end
57
73
 
58
- def add_suite(project_id, opts = {})
59
- send_post("add_suite/#{project_id}", opts)
74
+ # Get sections for suite
75
+ # @param suite_id [int]
76
+ # @param opts [hash]
77
+ # @see http://docs.gurock.com/testrail-api2/reference-sections
78
+ def get_sections(suite_id, opts = {})
79
+ send_get("get_sections/#{suite_id.to_s}", opts)
60
80
  end
61
81
 
82
+ # Add section to suite
83
+ # @param suite_id [int]
84
+ # @param opts [hash]
85
+ # @see http://docs.gurock.com/testrail-api2/reference-sections
62
86
  def add_section(suite_id, opts = {})
63
- send_post("add_section/#{suite_id}", opts)
64
- end
65
-
66
- def get_run(run_id, opts = {})
67
- send_get("get_run/#{run_id}", opts)
87
+ send_post("add_section/#{suite_id.to_s}", opts)
68
88
  end
69
89
 
70
- def get_runs(project_id, plan_id, opts = {})
71
- send_get("get_runs/#{project_id}/#{plan_id}", opts)
90
+ # Get milestone by milestone id
91
+ # @param milestone_id [int]
92
+ # @param opts [hash]
93
+ # @see http://docs.gurock.com/testrail-api2/reference-milestones
94
+ def get_milestone(milestone_id, opts = {})
95
+ send_get("get_milestone/#{milestone_id.to_s}", opts)
72
96
  end
73
97
 
74
- def add_run(suite_id, opts = {})
75
- send_post("add_run/#{suite_id}", opts)
98
+ # Get project milestones by project id
99
+ # @param project_id [int]
100
+ # @param opts [hash]
101
+ # @see http://docs.gurock.com/testrail-api2/reference-milestones
102
+ def get_milestones(project_id, opts = {})
103
+ send_get("get_milestones/#{project_id.to_s}", opts)
76
104
  end
77
105
 
78
- def close_run(run_id, opts = {})
79
- send_post("close_run/#{run_id}", opts)
106
+ # Add milestone to project id
107
+ # @param project_id [int]
108
+ # @param opts [hash]
109
+ # @see http://docs.gurock.com/testrail-api2/reference-milestones
110
+ def add_milestone(project_id, opts = {})
111
+ send_post("add_milestone/#{project_id.to_s}", opts)
80
112
  end
81
113
 
114
+ # Get plan by id
115
+ # @param plan_id [int]
116
+ # @param opts [hash]
117
+ # @see http://docs.gurock.com/testrail-api2/reference-plans
82
118
  def get_plan(plan_id, opts = {})
83
- send_get("get_plan/#{plan_id}", opts)
119
+ send_get("get_plan/#{plan_id.to_s}", opts)
84
120
  end
85
121
 
122
+ # Get plans in project by project id
123
+ # @param project_id [int]
124
+ # @param opts [hash]
125
+ # @see http://docs.gurock.com/testrail-api2/reference-plans
86
126
  def get_plans(project_id, opts = {})
87
- send_get("get_plans/#{project_id}", opts)
127
+ send_get("get_plans/#{project_id.to_s}", opts)
88
128
  end
89
129
 
130
+ # Add plan to project by project id
131
+ # @param project_id [int]
132
+ # @param opts [hash]
133
+ # @see http://docs.gurock.com/testrail-api2/reference-plans
90
134
  def add_plan(project_id, opts = {})
91
- send_post("add_plan/#{project_id}", opts)
135
+ send_post("add_plan/#{project_id.to_s}", opts)
92
136
  end
93
137
 
138
+ # Add plan entries by plan id
139
+ # @param plan_id [int]
140
+ # @param opts [hash]
141
+ # @see http://docs.gurock.com/testrail-api2/reference-plans
94
142
  def add_plan_entries(plan_id, opts = {})
95
- send_post("add_plan_entries/#{plan_id}", opts)
143
+ send_post("add_plan_entries/#{plan_id.to_s}", opts)
96
144
  end
97
145
 
146
+ # Close plan by plan id
147
+ # @param plan_id [int]
148
+ # @param opts [hash]
149
+ # @see http://docs.gurock.com/testrail-api2/reference-plans
98
150
  def close_plan(plan_id, opts = {})
99
- send_post("close_plan/#{plan_id}", opts)
151
+ send_post("close_plan/#{plan_id.to_s}", opts)
100
152
  end
101
153
 
102
- def get_milestone(milestone_id, opts = {})
103
- send_get("get_milestone/#{milestone_id}", opts)
154
+ # Get project by project id
155
+ # @param project_id [int]
156
+ # @param opts [hash]
157
+ # @see http://docs.gurock.com/testrail-api2/reference-projects
158
+ def get_project(project_id, opts = {})
159
+ send_get("get_project/#{project_id.to_s}", opts)
104
160
  end
105
161
 
106
- def get_milestones(project_id, opts = {})
107
- send_get("get_milestones/#{project_id}", opts)
162
+ # Get all projects
163
+ # @param opts [hash]
164
+ # @see http://docs.gurock.com/testrail-api2/reference-projects
165
+ def get_projects(opts = {})
166
+ send_get('get_projects', opts)
108
167
  end
109
168
 
110
- def add_milestone(project_id, opts = {})
111
- send_post("add_milestone/#{project_id}", opts)
169
+ # Add result to test by test id
170
+ # @param test_id [int]
171
+ # @param opts [hash]
172
+ # @see http://docs.gurock.com/testrail-api2/reference-results
173
+ def add_result(test_id, opts = {})
174
+ send_post("add_result/#{test_id.to_s}", opts)
112
175
  end
113
176
 
114
- def get_project(project_id, opts = {})
115
- send_get("get_project/#{project_id}", opts)
177
+ # Add result to case by case id
178
+ # @param run_id [int]
179
+ # @param case_id [int]
180
+ # @param opts [hash]
181
+ # @see http://docs.gurock.com/testrail-api2/reference-results
182
+ def add_result_for_case(run_id, case_id, opts = {})
183
+ send_post("add_result_for_case/#{run_id.to_s}/#{case_id.to_s}", opts)
116
184
  end
117
185
 
118
- def get_projects(opts = {})
119
- send_get('get_projects', opts)
186
+ # Get run by run id
187
+ # @param run_id [int]
188
+ # @param opts [hash]
189
+ # @see http://docs.gurock.com/testrail-api2/reference-runs
190
+ def get_run(run_id, opts = {})
191
+ send_get("get_run/#{run_id.to_s}", opts)
192
+ end
193
+
194
+ # Get runs by project id
195
+ # @param project_id [int]
196
+ # @param plan_id [int]
197
+ # @param opts [hash]
198
+ # @see http://docs.gurock.com/testrail-api2/reference-runs
199
+ # @note Might be broken
200
+ def get_runs(project_id, plan_id, opts = {})
201
+ send_get("get_runs/#{project_id.to_s}/#{plan_id.to_s}", opts)
120
202
  end
203
+
204
+ # Add run by suite id
205
+ # @param suite_id [int]
206
+ # @param opts [hash]
207
+ # @see http://docs.gurock.com/testrail-api2/reference-runs
208
+ def add_run(suite_id, opts = {})
209
+ send_post("add_run/#{suite_id.to_s}", opts)
210
+ end
211
+
212
+
213
+ # Close run by run id
214
+ # @param run_id [int]
215
+ # @param opts [hash]
216
+ # @see http://docs.gurock.com/testrail-api2/reference-runs
217
+ def close_run(run_id, opts = {})
218
+ send_post("close_run/#{run_id.to_s}", opts)
219
+ end
220
+
221
+ # Get test by test id
222
+ # @param test_id [int]
223
+ # @param opts [hash]
224
+ # @see http://docs.gurock.com/testrail-api2/reference-tests
225
+ def get_test(test_id, opts = {})
226
+ send_get("get_test/#{test_id.to_s}", opts)
227
+ end
228
+
229
+ # Get tests by run id
230
+ # @param run_id [int]
231
+ # @param opts [hash]
232
+ # @see http://docs.gurock.com/testrail-api2/reference-tests
233
+ def get_tests(run_id, opts = {})
234
+ send_get("get_tests/#{run_id.to_s}", opts)
235
+ end
236
+
121
237
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Testrail
2
- VERSION = '0.0.6'.freeze
2
+ VERSION = '0.0.7'.freeze
3
3
  end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ # RSpec.describe Testrail do
4
+ # it 'has a version number' do
5
+ # expect(Testrail::VERSION).not_to be nil
6
+ # end
7
+ # end
@@ -4,5 +4,4 @@ RSpec.describe Testrail do
4
4
  it 'has a version number' do
5
5
  expect(Testrail::VERSION).not_to be nil
6
6
  end
7
-
8
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrail-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frances Morales
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: yard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: A Ruby client wrapper for the TestRail API (v2)
84
98
  email: fmorales@francesmoralespec.com
85
99
  executables: []
@@ -99,7 +113,8 @@ files:
99
113
  - lib/testrail/deprecated/response.rb
100
114
  - lib/version.rb
101
115
  - spec/spec_helper.rb
102
- - spec/testrail/ruby_spec.rb
116
+ - spec/testrail/endpoints_spec.rb
117
+ - spec/testrail/version_spec.rb
103
118
  homepage: https://github.com/fmorales/TestRail-Ruby
104
119
  licenses:
105
120
  - MIT
@@ -126,4 +141,5 @@ specification_version: 4
126
141
  summary: Client wrapper in Ruby for TestRail API (v2)
127
142
  test_files:
128
143
  - spec/spec_helper.rb
129
- - spec/testrail/ruby_spec.rb
144
+ - spec/testrail/endpoints_spec.rb
145
+ - spec/testrail/version_spec.rb