parallel_tests 2.12.0 → 2.13.0

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: d1c6f6ab148c204b15f5c6e5c6762438622d9587
4
- data.tar.gz: 989f590bbd92bfbf7f485755f0c37df3e2985626
3
+ metadata.gz: 8c5093d00208e78bd29823d73e12a7409588adbd
4
+ data.tar.gz: f937ad2c7a3036ceda12fd4d2e432c45c5209822
5
5
  SHA512:
6
- metadata.gz: 53f224685a44607225d7c12acea0415e2548559ab4c15b4ca5a52073a228633b9473f56e18b394049ea1cb8d884f7a65bea3989f36f130c6c08ca0fc91e8390d
7
- data.tar.gz: 95e3759003ef26063f6f050410fdc1fdd2771ccef6579fea108d2cac7b83b9d5db7d72606f5a7258e3037d7f8c73ac2c4efae53e4c95cabab6586754e932fb24
6
+ metadata.gz: 61241e2a1133c15307e8b50ac845aa0655c2120a98356e4bd08e1e14fbfbbd5b7bde367e55e934ad538183f9daa3b83707613d933136805130a30612a7d76355
7
+ data.tar.gz: 1f7a44c636ade949d48cec7253186f3be7052cf9fdd711004060e445ed0b357d1263ddd010d5abae318f683ae46a5eab5900e6c6d7e00d8648c9786165ab47d2
@@ -11,33 +11,22 @@ module ParallelTests
11
11
  @tag_expression = tag_expression
12
12
  end
13
13
 
14
- def visit_feature_element(uri, feature_element)
15
- tags = feature_element[:tags].map {|tag| ::Cucumber::Core::Ast::Tag.new(tag[:location], tag[:name])}
16
-
17
- # We don't accept the feature_element if the current tags are not valid
18
- return unless @tag_expression.evaluate(tags)
19
- @scenarios << [uri, feature_element[:location][:line]].join(":")
20
-
21
- # TODO handle scenario outlines
22
- # Previous code
23
- # when ::Cucumber::Ast::ScenarioOutline
24
- # sections = feature_element.instance_variable_get(:@example_sections)
25
- # sections.each { |section|
26
- # rows = if section[1].respond_to?(:rows)
27
- # section[1].rows
28
- # else
29
- # section[1].instance_variable_get(:@rows)
30
- # end
31
- # rows.each_with_index { |row, index|
32
- # next if index == 0 # slices didn't work with jruby data structure
33
- # line = if row.respond_to?(:line)
34
- # row.line
35
- # else
36
- # row.instance_variable_get(:@line)
37
- # end
38
- # @scenarios << [feature_element.feature.file, line].join(":")
39
- # }
40
- # }
14
+ def visit_feature_element(uri, feature_element, feature_tags)
15
+ scenario_tags = feature_element[:tags].map {|tag| ::Cucumber::Core::Ast::Tag.new(tag[:location], tag[:name])}
16
+ scenario_tags = feature_tags + scenario_tags
17
+ if feature_element[:examples].nil? # :Scenario
18
+ # We don't accept the feature_element if the current tags are not valid
19
+ return unless @tag_expression.evaluate(scenario_tags)
20
+ @scenarios << [uri, feature_element[:location][:line]].join(":")
21
+ else # :ScenarioOutline
22
+ feature_element[:examples].each do |example|
23
+ example_tags = example[:tags].map {|tag| ::Cucumber::Core::Ast::Tag.new(tag[:location], tag[:name])}
24
+ example_tags = scenario_tags + example_tags
25
+ next unless @tag_expression.evaluate(example_tags)
26
+ rows = example[:tableBody].select { |body| body[:type] == :TableRow }
27
+ rows.each { |row| @scenarios << [uri, row[:location][:line]].join(':') }
28
+ end
29
+ end
41
30
  end
42
31
 
43
32
  def method_missing(*args)
@@ -42,16 +42,15 @@ module ParallelTests
42
42
  begin
43
43
  # We make an attempt to parse the gherkin document, this could be failed if the document is not well formated
44
44
  result = parser.parse(scanner)
45
+ feature_tags = result[:feature][:tags].map { |tag| ::Cucumber::Core::Ast::Tag.new(tag[:location], tag[:name]) }
45
46
 
46
47
  # We loop on each children of the feature
47
48
  result[:feature][:children].each do |feature_element|
48
- # If the type of the child is not a scenario, we continue, we are only interested by the name of the scenario here
49
- if feature_element[:type].to_s != 'Scenario'
50
- next
51
- end
49
+ # If the type of the child is not a scenario or scenario outline, we continue, we are only interested by the name of the scenario here
50
+ next unless /Scenario/.match(feature_element[:type])
52
51
 
53
52
  # It's a scenario, we add it to the scenario_line_logger
54
- scenario_line_logger.visit_feature_element(document.uri, feature_element)
53
+ scenario_line_logger.visit_feature_element(document.uri, feature_element, feature_tags)
55
54
  end
56
55
 
57
56
  rescue StandardError => e
@@ -1,3 +1,3 @@
1
1
  module ParallelTests
2
- VERSION = Version = '2.12.0'
2
+ VERSION = Version = '2.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-29 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel