gherkin 1.0.12-i386-mingw32 → 1.0.13-i386-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/VERSION.yml +1 -1
- data/lib/gherkin/parser/filter_listener.rb +9 -7
- data/lib/gherkin/parser/sexp.rb +1 -1
- data/spec/gherkin/parser/filter_listener_spec.rb +7 -5
- metadata +2 -2
data/History.txt
CHANGED
data/VERSION.yml
CHANGED
@@ -9,11 +9,11 @@ module Gherkin
|
|
9
9
|
java_impl('gherkin.jar')
|
10
10
|
|
11
11
|
# Creates a new instance that replays events to +listener+, filtered by +filters+,
|
12
|
-
#
|
12
|
+
# an Array that can contain one of the following:
|
13
13
|
#
|
14
|
-
# *
|
15
|
-
# *
|
16
|
-
# *
|
14
|
+
# * Line numbers (Fixnum) to filter on.
|
15
|
+
# * Name regexen (Regexp) to filter on. Matches against :feature, :background, :scenario, :scenario_outline and :examples
|
16
|
+
# * Tag expressions (String) to filter on.
|
17
17
|
#
|
18
18
|
def initialize(listener, filters)
|
19
19
|
@listener = listener
|
@@ -55,7 +55,7 @@ module Gherkin
|
|
55
55
|
@feature_buffer << sexp
|
56
56
|
@meta_buffer = []
|
57
57
|
@table_state = :background
|
58
|
-
@
|
58
|
+
@background_ok = true if filter_match?(sexp)
|
59
59
|
when :scenario
|
60
60
|
replay_examples_rows_buffer
|
61
61
|
@scenario_buffer = @meta_buffer
|
@@ -65,6 +65,7 @@ module Gherkin
|
|
65
65
|
@meta_buffer = []
|
66
66
|
@scenario_ok = filter_match?(*@scenario_buffer) || tag_match?
|
67
67
|
@examples_ok = false
|
68
|
+
@background_ok = false
|
68
69
|
@table_state = :step
|
69
70
|
when :scenario_outline
|
70
71
|
replay_examples_rows_buffer
|
@@ -75,6 +76,7 @@ module Gherkin
|
|
75
76
|
@meta_buffer = []
|
76
77
|
@scenario_ok = filter_match?(*@scenario_buffer)
|
77
78
|
@examples_ok = false
|
79
|
+
@background_ok = false
|
78
80
|
@table_state = :step
|
79
81
|
when :examples
|
80
82
|
replay_examples_rows_buffer
|
@@ -91,7 +93,7 @@ module Gherkin
|
|
91
93
|
@feature_buffer += @meta_buffer
|
92
94
|
@feature_buffer << sexp
|
93
95
|
@meta_buffer = []
|
94
|
-
@
|
96
|
+
@background_ok = true if filter_match?(sexp)
|
95
97
|
else
|
96
98
|
@scenario_buffer << sexp
|
97
99
|
@scenario_ok ||= filter_match?(*@scenario_buffer)
|
@@ -132,7 +134,7 @@ module Gherkin
|
|
132
134
|
super
|
133
135
|
end
|
134
136
|
|
135
|
-
if @scenario_ok || @examples_ok || @feature_ok
|
137
|
+
if @scenario_ok || @examples_ok || @feature_ok || @background_ok
|
136
138
|
replay_buffers
|
137
139
|
end
|
138
140
|
end
|
data/lib/gherkin/parser/sexp.rb
CHANGED
@@ -19,7 +19,7 @@ module Gherkin
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def name_match?(name_regexen)
|
22
|
-
return false unless [:feature, :scenario, :scenario_outline, :examples].include?(event)
|
22
|
+
return false unless [:feature, :background, :scenario, :scenario_outline, :examples].include?(event)
|
23
23
|
name_regexen.detect{|name_regex| name =~ name_regex}
|
24
24
|
end
|
25
25
|
|
@@ -180,12 +180,12 @@ Feature: 2
|
|
180
180
|
verify_filters([1,2,3,4,5,7,8,9,10,12,13,14,15,16,:eof], [])
|
181
181
|
end
|
182
182
|
|
183
|
-
it "should replay
|
184
|
-
verify_filters([1,2,3,4,5
|
183
|
+
it "should not replay any scenarios when filtering on the line of a background step" do
|
184
|
+
verify_filters([1,2,3,4,5,:eof], [5])
|
185
185
|
end
|
186
186
|
|
187
|
-
it "should replay
|
188
|
-
verify_filters([1,2,3,4,5
|
187
|
+
it "should not replay any scenarios when filtering on the line of the background" do
|
188
|
+
verify_filters([1,2,3,4,5,:eof], [4])
|
189
189
|
end
|
190
190
|
|
191
191
|
it "should replay the background on step line of first scenario" do
|
@@ -358,7 +358,7 @@ Feature: 3
|
|
358
358
|
end
|
359
359
|
|
360
360
|
context "Background with PyString" do
|
361
|
-
|
361
|
+
before do
|
362
362
|
@input = %{#language:en
|
363
363
|
Feature: 2
|
364
364
|
Background: 3
|
@@ -379,7 +379,9 @@ Feature: 2
|
|
379
379
|
18
|
380
380
|
"""
|
381
381
|
}
|
382
|
+
end
|
382
383
|
|
384
|
+
it "should replay itself properly" do
|
383
385
|
verify_filters([1,2,3,4,5,15,16,17,:eof], [15])
|
384
386
|
end
|
385
387
|
end
|