gherkin 2.10.0 → 2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +7 -0
- data/README.md +3 -4
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +489 -336
- data/gherkin.gemspec +3 -3
- data/lib/gherkin/formatter/filter_formatter.rb +1 -1
- data/lib/gherkin/formatter/json_formatter.rb +26 -11
- data/lib/gherkin/i18n.yml +1 -1
- data/lib/gherkin/json_parser.rb +33 -0
- data/lib/gherkin/rb_lexer/en.rb +495 -355
- data/spec/gherkin/formatter/filter_formatter_spec.rb +8 -0
- data/spec/gherkin/formatter/json_formatter_spec.rb +15 -2
- data/spec/gherkin/json_parser_spec.rb +83 -45
- metadata +23 -7
@@ -31,6 +31,14 @@ module Gherkin
|
|
31
31
|
io.string.strip.should == expected.strip
|
32
32
|
end
|
33
33
|
|
34
|
+
context "invalid mix" do
|
35
|
+
it "should throw exception on different filters" do
|
36
|
+
lambda do
|
37
|
+
verify_filter(['@tag1', /regexp/, 88], 1..61)
|
38
|
+
end.should raise_exception(/Inconsistent filters/)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
34
42
|
context "tags" do
|
35
43
|
it "should filter on feature tag" do
|
36
44
|
verify_filter(['@tag1'], 1..61)
|
@@ -12,15 +12,17 @@ module Gherkin
|
|
12
12
|
f.uri("f.feature")
|
13
13
|
f.feature(Model::Feature.new([], [], "Feature", "ff", "", 1, "ff"))
|
14
14
|
f.scenario(Model::Scenario.new([], [], "Scenario", "ss", "", 2, "ff/ss"))
|
15
|
-
f.step(Model::Step.new([], "Given ", "g", 3, nil, nil))
|
16
|
-
f.step(Model::Step.new([], "When ", "w", 4, nil, nil))
|
17
15
|
|
16
|
+
f.step(Model::Step.new([], "Given ", "g", 3, nil, nil))
|
18
17
|
f.match(Model::Match.new([], "def.rb:33"))
|
19
18
|
f.result(Model::Result.new(:passed, 1, nil))
|
20
19
|
|
20
|
+
f.step(Model::Step.new([], "When ", "w", 4, nil, nil))
|
21
21
|
f.match(Model::Match.new([], "def.rb:44"))
|
22
22
|
f.result(Model::Result.new(:passed, 1, nil))
|
23
23
|
|
24
|
+
f.after(Model::Match.new([], "def.rb:55"), Model::Result.new(:passed, 22, nil))
|
25
|
+
|
24
26
|
f.eof
|
25
27
|
f.done
|
26
28
|
|
@@ -66,6 +68,17 @@ module Gherkin
|
|
66
68
|
"duration": 1
|
67
69
|
}
|
68
70
|
}
|
71
|
+
],
|
72
|
+
"after": [
|
73
|
+
{
|
74
|
+
"match":{
|
75
|
+
"location":"def.rb:55"
|
76
|
+
},
|
77
|
+
"result":{
|
78
|
+
"status":"passed",
|
79
|
+
"duration": 22
|
80
|
+
}
|
81
|
+
}
|
69
82
|
]
|
70
83
|
}
|
71
84
|
]
|
@@ -79,55 +79,93 @@ module Gherkin
|
|
79
79
|
|
80
80
|
it "should parse feature with match, result and embedding" do
|
81
81
|
check_json(%{
|
82
|
-
|
83
|
-
{
|
84
|
-
"id": "one",
|
85
|
-
"uri": "test.feature",
|
86
|
-
"tags": [
|
82
|
+
[
|
87
83
|
{
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
{
|
102
|
-
"keyword": "Given ",
|
103
|
-
"name": "a passing step",
|
104
|
-
"line": 6,
|
105
|
-
"match": {
|
106
|
-
"arguments": [
|
107
|
-
{
|
108
|
-
"offset": 22,
|
109
|
-
"val": "cukes"
|
110
|
-
}
|
111
|
-
],
|
112
|
-
"location": "features/step_definitions/steps.rb:1"
|
113
|
-
},
|
114
|
-
"result": {
|
115
|
-
"status": "failed",
|
116
|
-
"error_message": "You suck",
|
117
|
-
"duration": -1
|
118
|
-
},
|
119
|
-
"embeddings": [
|
84
|
+
"id":"one",
|
85
|
+
"uri":"test.feature",
|
86
|
+
"tags":[
|
87
|
+
{
|
88
|
+
"name":"@foo",
|
89
|
+
"line":22
|
90
|
+
}
|
91
|
+
],
|
92
|
+
"keyword":"Feature",
|
93
|
+
"name":"One",
|
94
|
+
"description":"",
|
95
|
+
"line":3,
|
96
|
+
"elements":[
|
120
97
|
{
|
121
|
-
|
122
|
-
|
98
|
+
"id":"one/a-scenario",
|
99
|
+
"type":"scenario",
|
100
|
+
"before": [
|
101
|
+
{
|
102
|
+
"match":{
|
103
|
+
"location":"features/step_definitions/hooks.rb:1"
|
104
|
+
},
|
105
|
+
"result":{
|
106
|
+
"status":"passed",
|
107
|
+
"error_message":"Passed hook",
|
108
|
+
"duration": 3
|
109
|
+
}
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"match":{
|
113
|
+
"location":"features/step_definitions/hooks.rb:2"
|
114
|
+
},
|
115
|
+
"result":{
|
116
|
+
"status":"failed",
|
117
|
+
"error_message":"Failed hook",
|
118
|
+
"duration": 22
|
119
|
+
}
|
120
|
+
}
|
121
|
+
],
|
122
|
+
"steps":[
|
123
|
+
{
|
124
|
+
"keyword":"Given ",
|
125
|
+
"name":"a passing step",
|
126
|
+
"line":6,
|
127
|
+
"match":{
|
128
|
+
"arguments":[
|
129
|
+
{
|
130
|
+
"offset":22,
|
131
|
+
"val":"cukes"
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"location":"features/step_definitions/steps.rb:1"
|
135
|
+
},
|
136
|
+
"result":{
|
137
|
+
"status":"failed",
|
138
|
+
"error_message":"You suck",
|
139
|
+
"duration":-1
|
140
|
+
},
|
141
|
+
"embeddings":[
|
142
|
+
{
|
143
|
+
"mime_type":"text/plain",
|
144
|
+
"data":"Tm8sIEknbSBub3QgaW50ZXJlc3RlZCBpbiBkZXZlbG9waW5nIGEgcG93ZXJmdWwgYnJhaW4uIEFsbCBJJ20gYWZ0ZXIgaXMganVzdCBhIG1lZGlvY3JlIGJyYWluLCBzb21ldGhpbmcgbGlrZSB0aGUgUHJlc2lkZW50IG9mIHRoZSBBbWVyaWNhbiBUZWxlcGhvbmUgYW5kIFRlbGVncmFwaCBDb21wYW55Lg=="
|
145
|
+
}
|
146
|
+
],
|
147
|
+
"output":[
|
148
|
+
"Hello",
|
149
|
+
"World"
|
150
|
+
]
|
151
|
+
}
|
152
|
+
],
|
153
|
+
"after": [
|
154
|
+
{
|
155
|
+
"match":{
|
156
|
+
"location":"features/step_definitions/hooks.rb:3"
|
157
|
+
},
|
158
|
+
"result":{
|
159
|
+
"status":"failed",
|
160
|
+
"error_message":"Failed After",
|
161
|
+
"duration": 22
|
162
|
+
}
|
163
|
+
}
|
164
|
+
]
|
123
165
|
}
|
124
|
-
|
125
|
-
}
|
126
|
-
]
|
166
|
+
]
|
127
167
|
}
|
128
|
-
|
129
|
-
}
|
130
|
-
]
|
168
|
+
]
|
131
169
|
})
|
132
170
|
end
|
133
171
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-06-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake-compiler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.2.
|
55
|
+
version: 1.2.1
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - ! '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 1.2.
|
63
|
+
version: 1.2.1
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: rake
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.10.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
requirements:
|
109
109
|
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 2.
|
111
|
+
version: 2.10.0
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: rubyzip
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,6 +125,22 @@ dependencies:
|
|
125
125
|
- - ! '>='
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: 0.9.8
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: therubyracer
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 0.10.1
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: 0.10.1
|
128
144
|
- !ruby/object:Gem::Dependency
|
129
145
|
name: yard
|
130
146
|
requirement: !ruby/object:Gem::Requirement
|
@@ -543,7 +559,7 @@ rubyforge_project:
|
|
543
559
|
rubygems_version: 1.8.24
|
544
560
|
signing_key:
|
545
561
|
specification_version: 3
|
546
|
-
summary: gherkin-2.
|
562
|
+
summary: gherkin-2.11.0
|
547
563
|
test_files:
|
548
564
|
- features/escaped_pipes.feature
|
549
565
|
- features/feature_parser.feature
|