assertthat-bdd 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assertthat-bdd.rb +11 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c4651bc71ff0ac382616142383c8fbaaead663300bf1bff27c978dfadd8b08
|
4
|
+
data.tar.gz: 9df3b59f2726fa196806bc241f15b8875aab16efb5eecb6575ee3a8aaac191b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d008022710ba84b7caf9d9b6a9e119d61012031341d61e8ecc298a38dcb40e3fda81be87325d1c01ae910963852f60b7019d6cd178e7b0d01791d1e4961785af
|
7
|
+
data.tar.gz: 9406e8bae99ea54114ca31e06aafb1382cdeff7a66776830f15d171a7942c49c5b3281cafac8243e5b5155177253ed559c6443e53899c710eca17870f254ed79
|
data/lib/assertthat-bdd.rb
CHANGED
@@ -10,8 +10,18 @@ module AssertThatBDD
|
|
10
10
|
url = ['https://bdd.assertthat.app/rest/api/1/project/', projectId, '/features'].map(&:to_s).join('')
|
11
11
|
url = [jiraServerUrl,"/rest/assertthat/latest/project/",projectId,"/client/features"].map(&:to_s).join('') unless jiraServerUrl.nil?
|
12
12
|
resource = RestClient::Resource.new(url, :user => accessKey, :password => secretKey, :content_type => 'application/zip')
|
13
|
-
begin
|
14
13
|
resource.get(:accept => 'application/zip', params: {mode: mode, jql: jql, tags: tags}) do |response, request, result|
|
14
|
+
case response.code
|
15
|
+
when 401
|
16
|
+
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
|
17
|
+
return
|
18
|
+
when 400
|
19
|
+
puts '*** ERROR: ' + e.response
|
20
|
+
return
|
21
|
+
when 500
|
22
|
+
puts '*** ERROR: Jira server error (500)'
|
23
|
+
return
|
24
|
+
end
|
15
25
|
Dir.mkdir("#{outputFolder}") unless File.exists?("#{outputFolder}")
|
16
26
|
File.open("#{outputFolder}/features.zip", 'wb') {|f| f.write(response) }
|
17
27
|
features_count = 0
|
@@ -27,24 +37,6 @@ module AssertThatBDD
|
|
27
37
|
puts "*** INFO: #{features_count} features downloaded"
|
28
38
|
end
|
29
39
|
File.delete("#{outputFolder}/features.zip")
|
30
|
-
rescue => e
|
31
|
-
|
32
|
-
if e.respond_to?('response') then
|
33
|
-
if e.response.respond_to?('code') then
|
34
|
-
case e.response.code
|
35
|
-
when 401
|
36
|
-
puts '*** ERROR: Unauthorized error (401). Supplied secretKey/accessKey is invalid'
|
37
|
-
when 400
|
38
|
-
puts '*** ERROR: ' + e.response
|
39
|
-
when 500
|
40
|
-
puts '*** ERROR: Jira server error (500)'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
else
|
44
|
-
puts '*** ERROR: Failed download features: ' + e.message
|
45
|
-
end
|
46
|
-
return
|
47
|
-
end
|
48
40
|
end
|
49
41
|
end
|
50
42
|
end
|