testrail-rspec 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 14c3460accfa5aef3d8f57f57c858dcd207dd1f64934fb8702c142de9d161b45
4
- data.tar.gz: eb9bed24430b9de89dd4bbe41d5b937826dc3eaeeea79d2ebf2c396a1c7831bc
3
+ metadata.gz: ce6e7c3227ab4805455ffcce099437f8685260a0a25bc4a0fb66ed72048b6f2f
4
+ data.tar.gz: 41160a58d5b6ba71cb58b409832d9f0fd782d91b70449c711f08092ed37dba40
5
5
  SHA512:
6
- metadata.gz: 498c38f02616e3ddbb55fe0114e24c496368387148b3bf84a2fd0fbc72f7f5b7f74e1a78e0302bee611bd1f089b357a7a13f88e0db7522914d6a42977bc20693
7
- data.tar.gz: 328ab325f334dfd7a7557c8f0cab4265978873c03a14d96aba8fe495169079d80eed65118a0b231f578bb4336159297a4fb33ec2ccc8d13dff7d8d624c858baf
6
+ metadata.gz: a06a57ebb274320420ece55a89b0ef5867e92efbcd081cb7c50bb43b8918aca5e4613b939eded0f607445596c62dcaad814405c68303544fa23b017da88d59f9
7
+ data.tar.gz: 48be8a5e373230b268587d346e2fd2081e7f451d434ad4c0578071f287e672617e60a62e3fae0701beb05755634468ed1638fa50cb7472ffcc6b44adf9ed33bc
@@ -20,7 +20,15 @@ module TestrailRSpec
20
20
  def upload_result
21
21
 
22
22
  response = {}
23
- case_id = @scenario.metadata[:description].split(' ').first.scan(/\d+/).first rescue nil
23
+
24
+ case_list = []
25
+ @scenario.metadata[:description].split(' ').map do |e|
26
+ val = e.scan(/\d+/).first
27
+ next if val.nil?
28
+ case_list << val
29
+ end
30
+
31
+ return if case_list.empty?
24
32
 
25
33
  if (@scenario.exception) && (!@scenario.exception.message.include? 'pending')
26
34
  status_id = get_status_id 'failed'.to_sym
@@ -40,13 +48,11 @@ module TestrailRSpec
40
48
  @run_id = @@run_id rescue @@run_id = nil unless @config['run_id']
41
49
  @run_id = @@run_id = client.create_test_run("add_run/#{@config['project_id']}", { "suite_id": @config['suite_id']}) if @run_id.nil?
42
50
 
43
- if case_id && @run_id
51
+ case_list.map do |case_id|
44
52
  response = client.send_post(
45
53
  "add_result_for_case/#{@run_id}/#{case_id}",
46
54
  { status_id: status_id, comment: message }
47
55
  )
48
- else
49
- raise 'unable to get case id or run id'
50
56
  end
51
57
 
52
58
  response
@@ -1,3 +1,3 @@
1
1
  module TestrailRspec
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrail-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prashanth Sams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-16 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler