ruby-testrail 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGNlNzdkZjNjYmQ1ZmNiYTI4MWE1ZDBiNmU5NTA2NWM3ZGYwMDEyMw==
4
+ Njc1MTYzZmViY2Q1NmEzMWZjMDJjNzFjNzc3MDNiOTIzODMxNDAzMw==
5
5
  data.tar.gz: !binary |-
6
- NzNhNDMyY2ZhZDU4YjEyNGM3MTdmODQ0MjgxZWI5M2EwMTEwMDExOA==
6
+ NTc3MjU2MzU4ZmI1YmU0MjQxZDY4OGE3NzYwMWVlYmM3OTAyNzI5Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWZmMTBmMGE3ZTYwMDFmNWRhZGMyODFhZmUxMmE4OGM0ZDRiZDcyNzRlNWIw
10
- YjNhMzdmZjdkMmI5ZmM5NmEzZmQ2MTAzMTFiYzllYjM5NTE0OTUwZjQ1ZjYz
11
- ZWQ5MWVlNjJiNzllNTNmZGM3ZTQxODA2ZDk3MzI2MjMyNDQxMWI=
9
+ YjgxYWVjN2VlNmIzZWZmNDljNWE4OGVkOTQ1YWM0NjlhYTljYWVlYmJjNTZj
10
+ ODk4NDEzOWI3ZTZjYWZlMjY5NzIyOGM0MDlkZTM0ZDBmZWFmNDg4MjkxODMz
11
+ M2FlYmRjMjAzN2UyOTBkZWI5ZDE1MDFiMTY0Y2E1MjhkY2E2MjI=
12
12
  data.tar.gz: !binary |-
13
- NWIyZGM3MzJlYmIxOTlmOTJjYWYyZDUzNDdiZTEyNGRmNjZkOTdkZDE5NGQ2
14
- Y2VjM2M4YjdhMzdlYWU0ZWQxNzc2M2M1NDAyZTMzODcyM2Y0OTJiYjIyNGE4
15
- YTFkNjQwMDhlYWJjMTVkMGI2MWQ3NGVkYWYxZDc0MGQxYTA1YTQ=
13
+ YjkyZjRkYjljNjBlM2U4MWZhMTdlZTc0YjhiZjc5NDhlZjM5YzM3NjNiYWFl
14
+ NmQ4ZjRjYTY2ZDIyZGVmMDI1NzdiODgyZjI2N2ExYWU0Zjc0YWJhMDJlM2Jm
15
+ YzVlZjg4M2VmZWQ2M2M0NWI2NmI3MTI5NDZlNWQ1MjU0NDk4NjY=
@@ -19,29 +19,39 @@ module TestRail
19
19
 
20
20
  # Submits an scenario test results
21
21
  # If the test case exists, it will reuse the id, otherwise it will create a new Test Case in TestRails
22
- # @param scenario [Cucumber::RunningTestCase::ScenarioOutlineExample|Cucumber::RunningTestCase::Scenario]
23
- # A test case scenario after execution
22
+ # @param scenario [Cucumber Scenario|Cucumber Scenario Outline] A test case scenario after execution
24
23
  def submit(scenario)
25
24
  return unless @enabled
26
25
  case scenario.class.name
27
26
  when 'Cucumber::RunningTestCase::ScenarioOutlineExample'
28
- test_case_section = scenario.scenario_outline.feature.name.strip
29
- test_case_name = scenario.scenario_outline.name.strip
30
- test_result = !scenario.failed?
31
- test_comment = scenario.exception
27
+ test_results = resolve_from_scenario_outline(scenario)
28
+ when 'Cucumber::Ast::ScenarioOutline'
29
+ test_results = resolve_from_scenario_outline(scenario)
32
30
  when 'Cucumber::RunningTestCase::Scenario'
33
- test_case_section = scenario.feature.name.strip
34
- test_case_name = scenario.name.strip
35
- test_result = !scenario.failed?
36
- test_comment = scenario.exception
31
+ test_results = resolve_from_simple_scenario(scenario)
32
+ when 'Cucumber::Ast::Scenario'
33
+ test_results = resolve_from_simple_scenario(scenario)
37
34
  end
38
35
 
39
- submit_test_result(
40
- section_name: test_case_section,
41
- test_name: test_case_name,
42
- success: test_result,
43
- comment: test_comment
44
- )
36
+ submit_test_result(test_results)
37
+ end
38
+
39
+ def resolve_from_scenario_outline(scenario)
40
+ {
41
+ section_name: scenario.scenario_outline.feature.name.strip,
42
+ test_name: scenario.scenario_outline.name.strip,
43
+ success: !scenario.failed?,
44
+ comment: scenario.exception
45
+ }
46
+ end
47
+
48
+ def resolve_from_simple_scenario(scenario)
49
+ {
50
+ section_name: scenario.feature.name.strip,
51
+ test_name: scenario.name.strip,
52
+ success: !scenario.failed?,
53
+ comment: scenario.exception
54
+ }
45
55
  end
46
56
 
47
57
  end
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'ruby-testrail'
3
- spec.version = '1.2.0'
3
+ spec.version = '1.2.2'
4
4
  spec.date = '2016-04-26'
5
5
  spec.summary = 'Ruby TestRail integration with RSpec and Cucumber Test Suites'
6
6
  spec.description = 'Library to integrate Test Suite with TestRail'
7
7
  spec.authors = ['Javier Durante', 'Will Gauvin', 'Nathan Jones']
8
8
  spec.email = 'mercury@findly.com'
9
9
  spec.license = 'Apache-2.0'
10
- spec.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ }
10
+ spec.files = `git ls-files`.split("\n").reject { |path| path =~ /\.gitignore$/ }
11
11
  spec.homepage = 'https://github.com/Findly-Inc/ruby-testrail'
12
12
  spec.add_development_dependency 'rspec', '>= 3.0'
13
13
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-testrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Durante