mustard_client 0.1.46 → 0.1.47

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa7da52abbc2603e5332aa03ffebd3ec59d4cc32
4
- data.tar.gz: ba25c3e441c38e02eb1c86668239ddb87c87f05c
3
+ metadata.gz: b1df2808b3e0f96fc4b3a9fc598125a382c83a68
4
+ data.tar.gz: 506aefd4dbd34893f9897f33eff74e5baf5a1050
5
5
  SHA512:
6
- metadata.gz: a883c5dd4d1865115b5086935a3d122184529fbcf4d2c23fdf1b88d2663ce39bd30706c5db8295c4a654ce88f832744d2bbe6d58df5013df267bee123d94bb8f
7
- data.tar.gz: 38c560945e64d96b38c0219b23699d1340066022d4db0aecb365a5548f19e76b503bdfff5a56c79dce4fefa5b26a0df6e511d0740193396f6840de52e35447c2
6
+ metadata.gz: 1e62d96c9002cb904eb4d1f96050368f07bb11c98e146f72b5ea1b4b8ef6904b78e5f9484c23969c5b91d6148740af25996b158630e819b5a76ca90951691aee
7
+ data.tar.gz: 205dffb0ea62ec88b9755998a84b9c63ecbbc1d4d3cbae63bdf2e7ffd6340a95628d1d3252832f969d789cc3ef5a301f175064d1ef1f4ca04a476ca649e42442
@@ -133,14 +133,38 @@ module MustardClient
133
133
 
134
134
  end
135
135
 
136
- def next_test execution_id, keyword: false
136
+ def next_test execution_id, keywords: []
137
+
138
+ keywords = parse_keywords keywords unless keywords.blank?
137
139
 
138
140
  command = {}
139
141
  command[:method] = :get
140
- if keyword
141
- command[:route] = @mustard_url + "/executions/#{execution_id}/next_test?keyword=#{keyword.upcase}"
142
- else
142
+
143
+ if keywords.blank?
143
144
  command[:route] = @mustard_url + "/executions/#{execution_id}/next_test"
145
+ else
146
+ keywords_string = keywords.map{|keyword| "keywords[]=#{keyword.upcase}"}.join('&')
147
+ command[:route] = @mustard_url + "/executions/#{execution_id}/next_test?#{keywords_string}"
148
+ end
149
+
150
+ command[:headers] = {'User-Token' => @user_token}
151
+
152
+ execute(command)
153
+
154
+ end
155
+
156
+ def incomplete_tests execution_id, keywords: []
157
+
158
+ keywords = parse_keywords keywords unless keywords.blank?
159
+
160
+ command = {}
161
+ command[:method] = :get
162
+
163
+ if keywords.blank?
164
+ command[:route] = @mustard_url + "/executions/#{execution_id}/incomplete_tests"
165
+ else
166
+ keywords_string = keywords.map{|keyword| "keywords[]=#{keyword.upcase}"}.join('&')
167
+ command[:route] = @mustard_url + "/executions/#{execution_id}/next_test?#{keywords_string}"
144
168
  end
145
169
 
146
170
  command[:headers] = {'User-Token' => @user_token}
@@ -150,4 +174,14 @@ module MustardClient
150
174
  end
151
175
 
152
176
  end
177
+
178
+ private
179
+
180
+ def parse_keywords keyword
181
+ if keyword.kind_of? Array
182
+ return keyword
183
+ else
184
+ return [keyword]
185
+ end
186
+ end
153
187
  end
@@ -1,3 +1,3 @@
1
1
  module MustardClient
2
- VERSION = "0.1.46"
2
+ VERSION = "0.1.47"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mustard_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Watson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler