gherkin 2.11.6-x86-mswin32 → 2.11.7-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -1
- data/Gemfile +1 -1
- data/History.md +13 -0
- data/README.md +10 -4
- data/examples/parse_and_output_json.rb +2 -2
- data/features/.cucumber/stepdefs.json +66 -66
- data/features/step_definitions/json_formatter_steps.rb +4 -4
- data/features/step_definitions/json_parser_steps.rb +2 -1
- data/features/support/env.rb +2 -3
- data/gherkin.gemspec +8 -6
- data/lib/1.8/gherkin_lexer_ar.so +0 -0
- data/lib/1.8/gherkin_lexer_bg.so +0 -0
- data/lib/1.8/gherkin_lexer_bm.so +0 -0
- data/lib/1.8/gherkin_lexer_ca.so +0 -0
- data/lib/1.8/gherkin_lexer_cs.so +0 -0
- data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.8/gherkin_lexer_da.so +0 -0
- data/lib/1.8/gherkin_lexer_de.so +0 -0
- data/lib/1.8/gherkin_lexer_el.so +0 -0
- data/lib/1.8/gherkin_lexer_en.so +0 -0
- data/lib/1.8/gherkin_lexer_en_au.so +0 -0
- data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.8/gherkin_lexer_en_old.so +0 -0
- data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.8/gherkin_lexer_eo.so +0 -0
- data/lib/1.8/gherkin_lexer_es.so +0 -0
- data/lib/1.8/gherkin_lexer_et.so +0 -0
- data/lib/1.8/gherkin_lexer_fa.so +0 -0
- data/lib/1.8/gherkin_lexer_fi.so +0 -0
- data/lib/1.8/gherkin_lexer_fr.so +0 -0
- data/lib/1.8/gherkin_lexer_he.so +0 -0
- data/lib/1.8/gherkin_lexer_hi.so +0 -0
- data/lib/1.8/gherkin_lexer_hr.so +0 -0
- data/lib/1.8/gherkin_lexer_hu.so +0 -0
- data/lib/1.8/gherkin_lexer_id.so +0 -0
- data/lib/1.8/gherkin_lexer_is.so +0 -0
- data/lib/1.8/gherkin_lexer_it.so +0 -0
- data/lib/1.8/gherkin_lexer_ja.so +0 -0
- data/lib/1.8/gherkin_lexer_ko.so +0 -0
- data/lib/1.8/gherkin_lexer_lt.so +0 -0
- data/lib/1.8/gherkin_lexer_lu.so +0 -0
- data/lib/1.8/gherkin_lexer_lv.so +0 -0
- data/lib/1.8/gherkin_lexer_nl.so +0 -0
- data/lib/1.8/gherkin_lexer_no.so +0 -0
- data/lib/1.8/gherkin_lexer_pl.so +0 -0
- data/lib/1.8/gherkin_lexer_pt.so +0 -0
- data/lib/1.8/gherkin_lexer_ro.so +0 -0
- data/lib/1.8/gherkin_lexer_ru.so +0 -0
- data/lib/1.8/gherkin_lexer_sk.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.8/gherkin_lexer_sv.so +0 -0
- data/lib/1.8/gherkin_lexer_tl.so +0 -0
- data/lib/1.8/gherkin_lexer_tr.so +0 -0
- data/lib/1.8/gherkin_lexer_tt.so +0 -0
- data/lib/1.8/gherkin_lexer_uk.so +0 -0
- data/lib/1.8/gherkin_lexer_uz.so +0 -0
- data/lib/1.8/gherkin_lexer_vi.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
- data/lib/1.9/gherkin_lexer_ar.so +0 -0
- data/lib/1.9/gherkin_lexer_bg.so +0 -0
- data/lib/1.9/gherkin_lexer_bm.so +0 -0
- data/lib/1.9/gherkin_lexer_ca.so +0 -0
- data/lib/1.9/gherkin_lexer_cs.so +0 -0
- data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.9/gherkin_lexer_da.so +0 -0
- data/lib/1.9/gherkin_lexer_de.so +0 -0
- data/lib/1.9/gherkin_lexer_el.so +0 -0
- data/lib/1.9/gherkin_lexer_en.so +0 -0
- data/lib/1.9/gherkin_lexer_en_au.so +0 -0
- data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.9/gherkin_lexer_en_old.so +0 -0
- data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.9/gherkin_lexer_eo.so +0 -0
- data/lib/1.9/gherkin_lexer_es.so +0 -0
- data/lib/1.9/gherkin_lexer_et.so +0 -0
- data/lib/1.9/gherkin_lexer_fa.so +0 -0
- data/lib/1.9/gherkin_lexer_fi.so +0 -0
- data/lib/1.9/gherkin_lexer_fr.so +0 -0
- data/lib/1.9/gherkin_lexer_he.so +0 -0
- data/lib/1.9/gherkin_lexer_hi.so +0 -0
- data/lib/1.9/gherkin_lexer_hr.so +0 -0
- data/lib/1.9/gherkin_lexer_hu.so +0 -0
- data/lib/1.9/gherkin_lexer_id.so +0 -0
- data/lib/1.9/gherkin_lexer_is.so +0 -0
- data/lib/1.9/gherkin_lexer_it.so +0 -0
- data/lib/1.9/gherkin_lexer_ja.so +0 -0
- data/lib/1.9/gherkin_lexer_ko.so +0 -0
- data/lib/1.9/gherkin_lexer_lt.so +0 -0
- data/lib/1.9/gherkin_lexer_lu.so +0 -0
- data/lib/1.9/gherkin_lexer_lv.so +0 -0
- data/lib/1.9/gherkin_lexer_nl.so +0 -0
- data/lib/1.9/gherkin_lexer_no.so +0 -0
- data/lib/1.9/gherkin_lexer_pl.so +0 -0
- data/lib/1.9/gherkin_lexer_pt.so +0 -0
- data/lib/1.9/gherkin_lexer_ro.so +0 -0
- data/lib/1.9/gherkin_lexer_ru.so +0 -0
- data/lib/1.9/gherkin_lexer_sk.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.9/gherkin_lexer_sv.so +0 -0
- data/lib/1.9/gherkin_lexer_tl.so +0 -0
- data/lib/1.9/gherkin_lexer_tr.so +0 -0
- data/lib/1.9/gherkin_lexer_tt.so +0 -0
- data/lib/1.9/gherkin_lexer_uk.so +0 -0
- data/lib/1.9/gherkin_lexer_uz.so +0 -0
- data/lib/1.9/gherkin_lexer_vi.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
- data/lib/gherkin/formatter/json_formatter.rb +5 -5
- data/lib/gherkin/formatter/tag_filter.rb +2 -2
- data/lib/gherkin/i18n.json +28 -0
- data/lib/gherkin/i18n.rb +6 -6
- data/lib/gherkin/json_parser.rb +4 -4
- data/lib/gherkin/native/java.rb +2 -2
- data/lib/gherkin/parser/parser.rb +1 -0
- data/lib/gherkin/platform.rb +12 -0
- data/lib/gherkin/tag_expression.rb +7 -1
- data/spec/gherkin/formatter/json_formatter_spec.rb +74 -3
- data/spec/gherkin/i18n_spec.rb +2 -0
- data/spec/gherkin/json_parser_spec.rb +11 -10
- data/spec/gherkin/parser/parser_spec.rb +1 -1
- data/spec/gherkin/tag_expression_spec.rb +19 -15
- data/spec/spec_helper.rb +4 -1
- data/tasks/rspec.rake +1 -2
- metadata +103 -166
- data/lib/gherkin/lexer/tl.rb +0 -1723
- data/lib/gherkin/lexer/tt.rb +0 -1640
- data/spec/gherkin/output_stream_string_io.rb +0 -20
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/History.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## [2.11.7](https://github.com/cucumber/gherkin/compare/v2.11.6...v2.11.7)
|
2
|
+
|
3
|
+
* [Java, JRuby] Fix ArrayOutOfBoundException in JSONFormatter ([#239](https://github.com/cucumber/gherkin/issues/239) Joseph Hughes)
|
4
|
+
* [Java, Ruby] JSONFormatter outputs prettyfied json (Oleg Sukhodolsky)
|
5
|
+
* [Java, JRuby] JSONFormatter.appendDuration(), TagExpression.isEmpty() added to match ruby versions ([#234](https://github.com/cucumber/gherkin/issues/234) Oleg Sukhodolsky)
|
6
|
+
* [Core] New: Greek ([#237](https://github.com/cucumber/gherkin/issues/237), [#244](https://github.com/cucumber/gherkin/issues/244) Konstantinos Rousis)
|
7
|
+
* [Core] New: Old English (Englisc) added ([#240](https://github.com/cucumber/gherkin/issues/240), [#241](https://github.com/cucumber/gherkin/issues/241) Sean Miller)
|
8
|
+
* [JRuby] fixed problem with passing StringIO to PrettyFormatter (Oleg Sukhodolsky)
|
9
|
+
* [Ruby] MultiJson is used insted of JSon ([#235](https://github.com/cucumber/gherkin/issues/235) Erik Michaels-Ober)
|
10
|
+
* [Ruby] TagExpression.eval() deprecated, TagExpression.evaluate() added to replace it. ([#238](https://github.com/cucumber/gherkin/issues/238) Oleg Sukhodolsky)
|
11
|
+
* [Ruby] File name is displayed on parse error ([#247](https://github.com/cucumber/gherkin/issues/247), [#248](https://github.com/cucumber/gherkin/issues/248) @lukaso)
|
12
|
+
* [Java, JRuby] Fix IndexOutOfBound exception in PrettyFormatter ([#175](https://github.com/cucumber/gherkin/issues/175), [#242](https://github.com/cucumber/gherkin/issues/242) Matheus Neves, Oleg Sukhodolsky)
|
13
|
+
|
1
14
|
## [2.11.6](https://github.com/cucumber/gherkin/compare/v2.11.5...v2.11.6)
|
2
15
|
|
3
16
|
* [JavaScript] Add duration value to json formatter ([#204](https://github.com/cucumber/gherkin/pull/204) Rick Beyer)
|
data/README.md
CHANGED
@@ -54,7 +54,7 @@ The jar file is in the central Maven repo.
|
|
54
54
|
<dependency>
|
55
55
|
<groupId>info.cukes</groupId>
|
56
56
|
<artifactId>gherkin</artifactId>
|
57
|
-
<version>2.11.
|
57
|
+
<version>2.11.7</version>
|
58
58
|
</dependency>
|
59
59
|
|
60
60
|
You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
|
@@ -128,6 +128,7 @@ In order to build and test Gherkin for JavaScript you must install:
|
|
128
128
|
|
129
129
|
* Node.js (0.6.17 or higher with npm)
|
130
130
|
* Ragel with JavaScript support: http://github.com/dominicmarks/ragel-js
|
131
|
+
* Make sure you have gcc/g++ 4.6 (4.7 is to strict to build ragel-js)
|
131
132
|
* Make sure you have `autoconf` and `automake` (`brew install automake`)
|
132
133
|
* Make sure you have the official ragel (`brew install ragel`)
|
133
134
|
* Make sure you have kelbt (`brew install kelbt`). If that fails, install manually from http://www.complang.org/kelbt/
|
@@ -135,9 +136,13 @@ In order to build and test Gherkin for JavaScript you must install:
|
|
135
136
|
* `make && make install`
|
136
137
|
* Define the GHERKIN_JS environment variable in your shell (any value will do)
|
137
138
|
|
139
|
+
Update gems (to install gems which are needed only for js support):
|
140
|
+
|
141
|
+
bundle update
|
142
|
+
|
138
143
|
Now you can build the JavaScript with:
|
139
144
|
|
140
|
-
rake js
|
145
|
+
bundle exec rake js
|
141
146
|
|
142
147
|
And you can try it out with node.js:
|
143
148
|
|
@@ -171,6 +176,7 @@ You must also download NuGet.exe from [CodePlex](http://nuget.codeplex.com/relea
|
|
171
176
|
|
172
177
|
# The key is at https://nuget.org/account
|
173
178
|
mono --runtime=v4.0.30319 /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
|
179
|
+
(Note: you may need to run 'mozroots --import --sync' to help mono trusts https setificate, see http://monomvc.wordpress.com/2012/03/06/nuget-on-mono/ for more information)
|
174
180
|
|
175
181
|
Now you can build the .NET dll with:
|
176
182
|
|
@@ -251,7 +257,7 @@ Now we can release:
|
|
251
257
|
* Make sure GHERKIN_JS is defined (see JavaScript section above)
|
252
258
|
* Bump version in:
|
253
259
|
* This file (Installation/Java section)
|
254
|
-
* gherkin.
|
260
|
+
* lib/gherkin/platform.rb
|
255
261
|
* java/pom.xml
|
256
262
|
* js/package.json
|
257
263
|
* History.md
|
@@ -260,7 +266,7 @@ Now we can release:
|
|
260
266
|
* Run `i686-w64-mingw32-gcc -v && bundle exec rake gems:prepare && ./build_native_gems.sh && bundle exec rake release:ALL`
|
261
267
|
|
262
268
|
## Note on Patches/Pull Requests
|
263
|
-
|
269
|
+
|
264
270
|
* Fork the project.
|
265
271
|
* Run `bundle install` to install dependencies.
|
266
272
|
* Run `rake` to make sure all the tests are passing.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'gherkin/parser/parser'
|
2
2
|
require 'gherkin/formatter/json_formatter'
|
3
3
|
require 'stringio'
|
4
|
-
require '
|
4
|
+
require 'multi_json'
|
5
5
|
|
6
6
|
# This example reads a couple of features and outputs them as JSON.
|
7
7
|
|
@@ -16,4 +16,4 @@ sources.each do |s|
|
|
16
16
|
end
|
17
17
|
|
18
18
|
formatter.done
|
19
|
-
puts
|
19
|
+
puts MultiJson.dump(MultiJson.load(io.string), :pretty => true)
|
@@ -1,243 +1,243 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"file_colon_line": "features/step_definitions/eyeball_steps.rb:1",
|
4
|
-
"flags": "",
|
5
3
|
"source": "^they have arrived$",
|
4
|
+
"flags": "",
|
5
|
+
"file_colon_line": "features/step_definitions/eyeball_steps.rb:1",
|
6
6
|
"steps": [
|
7
7
|
{
|
8
|
+
"name": "they have arrived",
|
8
9
|
"args": [
|
9
10
|
|
10
|
-
]
|
11
|
-
"name": "they have arrived"
|
11
|
+
]
|
12
12
|
}
|
13
13
|
]
|
14
14
|
},
|
15
15
|
{
|
16
|
-
"file_colon_line": "features/step_definitions/gherkin_steps.rb:1",
|
17
|
-
"flags": "",
|
18
16
|
"source": "^a \"(ruby|native)\" \"([^\\\"]*)\" parser$",
|
17
|
+
"flags": "",
|
18
|
+
"file_colon_line": "features/step_definitions/gherkin_steps.rb:1",
|
19
19
|
"steps": [
|
20
20
|
|
21
21
|
]
|
22
22
|
},
|
23
23
|
{
|
24
|
-
"file_colon_line": "features/step_definitions/gherkin_steps.rb:5",
|
25
|
-
"flags": "",
|
26
24
|
"source": "^the\\ following\\ text\\ is\\ parsed:$",
|
25
|
+
"flags": "",
|
26
|
+
"file_colon_line": "features/step_definitions/gherkin_steps.rb:5",
|
27
27
|
"steps": [
|
28
28
|
{
|
29
|
+
"name": "the following text is parsed:",
|
29
30
|
"args": [
|
30
31
|
|
31
|
-
]
|
32
|
-
"name": "the following text is parsed:"
|
32
|
+
]
|
33
33
|
}
|
34
34
|
]
|
35
35
|
},
|
36
36
|
{
|
37
|
-
"file_colon_line": "features/step_definitions/gherkin_steps.rb:9",
|
38
|
-
"flags": "",
|
39
37
|
"source": "^there\\ should\\ be\\ no\\ parse\\ errors$",
|
38
|
+
"flags": "",
|
39
|
+
"file_colon_line": "features/step_definitions/gherkin_steps.rb:9",
|
40
40
|
"steps": [
|
41
41
|
{
|
42
|
+
"name": "there should be no parse errors",
|
42
43
|
"args": [
|
43
44
|
|
44
|
-
]
|
45
|
-
"name": "there should be no parse errors"
|
45
|
+
]
|
46
46
|
}
|
47
47
|
]
|
48
48
|
},
|
49
49
|
{
|
50
|
-
"file_colon_line": "features/step_definitions/gherkin_steps.rb:13",
|
51
|
-
"flags": "",
|
52
50
|
"source": "^there should be a parse error on (line \\d+)$",
|
51
|
+
"flags": "",
|
52
|
+
"file_colon_line": "features/step_definitions/gherkin_steps.rb:13",
|
53
53
|
"steps": [
|
54
54
|
{
|
55
|
+
"name": "there should be a parse error on line 1",
|
55
56
|
"args": [
|
56
57
|
{
|
57
58
|
"offset": 33,
|
58
59
|
"val": "line 1"
|
59
60
|
}
|
60
|
-
]
|
61
|
-
"name": "there should be a parse error on line 1"
|
61
|
+
]
|
62
62
|
}
|
63
63
|
]
|
64
64
|
},
|
65
65
|
{
|
66
|
-
"file_colon_line": "features/step_definitions/gherkin_steps.rb:17",
|
67
|
-
"flags": "",
|
68
66
|
"source": "^there should be parse errors on (lines .*)$",
|
67
|
+
"flags": "",
|
68
|
+
"file_colon_line": "features/step_definitions/gherkin_steps.rb:17",
|
69
69
|
"steps": [
|
70
70
|
{
|
71
|
+
"name": "there should be parse errors on lines 1 and 2",
|
71
72
|
"args": [
|
72
73
|
{
|
73
74
|
"offset": 32,
|
74
75
|
"val": "lines 1 and 2"
|
75
76
|
}
|
76
|
-
]
|
77
|
-
"name": "there should be parse errors on lines 1 and 2"
|
77
|
+
]
|
78
78
|
},
|
79
79
|
{
|
80
|
+
"name": "there should be parse errors on lines 1 through 3",
|
80
81
|
"args": [
|
81
82
|
{
|
82
83
|
"offset": 32,
|
83
84
|
"val": "lines 1 through 3"
|
84
85
|
}
|
85
|
-
]
|
86
|
-
"name": "there should be parse errors on lines 1 through 3"
|
86
|
+
]
|
87
87
|
},
|
88
88
|
{
|
89
|
+
"name": "there should be parse errors on lines 10 and 17",
|
89
90
|
"args": [
|
90
91
|
{
|
91
92
|
"offset": 32,
|
92
93
|
"val": "lines 10 and 17"
|
93
94
|
}
|
94
|
-
]
|
95
|
-
"name": "there should be parse errors on lines 10 and 17"
|
95
|
+
]
|
96
96
|
},
|
97
97
|
{
|
98
|
+
"name": "there should be parse errors on lines 3 and 5",
|
98
99
|
"args": [
|
99
100
|
{
|
100
101
|
"offset": 32,
|
101
102
|
"val": "lines 3 and 5"
|
102
103
|
}
|
103
|
-
]
|
104
|
-
"name": "there should be parse errors on lines 3 and 5"
|
104
|
+
]
|
105
105
|
},
|
106
106
|
{
|
107
|
+
"name": "there should be parse errors on lines 5, 10 and 12",
|
107
108
|
"args": [
|
108
109
|
{
|
109
110
|
"offset": 32,
|
110
111
|
"val": "lines 5, 10 and 12"
|
111
112
|
}
|
112
|
-
]
|
113
|
-
"name": "there should be parse errors on lines 5, 10 and 12"
|
113
|
+
]
|
114
114
|
}
|
115
115
|
]
|
116
116
|
},
|
117
117
|
{
|
118
|
-
"file_colon_line": "features/step_definitions/json_formatter_steps.rb:13",
|
119
|
-
"flags": "",
|
120
118
|
"source": "^a JSON formatter$",
|
119
|
+
"flags": "",
|
120
|
+
"file_colon_line": "features/step_definitions/json_formatter_steps.rb:13",
|
121
121
|
"steps": [
|
122
122
|
|
123
123
|
]
|
124
124
|
},
|
125
125
|
{
|
126
|
-
"file_colon_line": "features/step_definitions/json_formatter_steps.rb:18",
|
127
|
-
"flags": "",
|
128
126
|
"source": "^the outputted JSON should be:$",
|
127
|
+
"flags": "",
|
128
|
+
"file_colon_line": "features/step_definitions/json_formatter_steps.rb:18",
|
129
129
|
"steps": [
|
130
130
|
{
|
131
|
+
"name": "the outputted JSON should be:",
|
131
132
|
"args": [
|
132
133
|
|
133
|
-
]
|
134
|
-
"name": "the outputted JSON should be:"
|
134
|
+
]
|
135
135
|
}
|
136
136
|
]
|
137
137
|
},
|
138
138
|
{
|
139
|
-
"file_colon_line": "features/step_definitions/json_parser_steps.rb:5",
|
140
|
-
"flags": "",
|
141
139
|
"source": "^a PrettyFormatter$",
|
140
|
+
"flags": "",
|
141
|
+
"file_colon_line": "features/step_definitions/json_parser_steps.rb:6",
|
142
142
|
"steps": [
|
143
143
|
|
144
144
|
]
|
145
145
|
},
|
146
146
|
{
|
147
|
-
"file_colon_line": "features/step_definitions/json_parser_steps.rb:10",
|
148
|
-
"flags": "",
|
149
147
|
"source": "^a JSON lexer$",
|
148
|
+
"flags": "",
|
149
|
+
"file_colon_line": "features/step_definitions/json_parser_steps.rb:11",
|
150
150
|
"steps": [
|
151
151
|
|
152
152
|
]
|
153
153
|
},
|
154
154
|
{
|
155
|
-
"file_colon_line": "features/step_definitions/json_parser_steps.rb:14",
|
156
|
-
"flags": "",
|
157
155
|
"source": "^the following JSON is parsed:$",
|
156
|
+
"flags": "",
|
157
|
+
"file_colon_line": "features/step_definitions/json_parser_steps.rb:15",
|
158
158
|
"steps": [
|
159
159
|
{
|
160
|
+
"name": "the following JSON is parsed:",
|
160
161
|
"args": [
|
161
162
|
|
162
|
-
]
|
163
|
-
"name": "the following JSON is parsed:"
|
163
|
+
]
|
164
164
|
}
|
165
165
|
]
|
166
166
|
},
|
167
167
|
{
|
168
|
-
"file_colon_line": "features/step_definitions/json_parser_steps.rb:18",
|
169
|
-
"flags": "",
|
170
168
|
"source": "^the outputted text should be:$",
|
169
|
+
"flags": "",
|
170
|
+
"file_colon_line": "features/step_definitions/json_parser_steps.rb:19",
|
171
171
|
"steps": [
|
172
172
|
{
|
173
|
+
"name": "the outputted text should be:",
|
173
174
|
"args": [
|
174
175
|
|
175
|
-
]
|
176
|
-
"name": "the outputted text should be:"
|
176
|
+
]
|
177
177
|
}
|
178
178
|
]
|
179
179
|
},
|
180
180
|
{
|
181
|
-
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:50",
|
182
|
-
"flags": "",
|
183
181
|
"source": "^I have Cucumber's source code next to Gherkin's$",
|
182
|
+
"flags": "",
|
183
|
+
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:50",
|
184
184
|
"steps": [
|
185
185
|
{
|
186
|
+
"name": "I have Cucumber's source code next to Gherkin's",
|
186
187
|
"args": [
|
187
188
|
|
188
|
-
]
|
189
|
-
"name": "I have Cucumber's source code next to Gherkin's"
|
189
|
+
]
|
190
190
|
}
|
191
191
|
]
|
192
192
|
},
|
193
193
|
{
|
194
|
-
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:55",
|
195
|
-
"flags": "",
|
196
194
|
"source": "^I find all of the \\.feature files$",
|
195
|
+
"flags": "",
|
196
|
+
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:55",
|
197
197
|
"steps": [
|
198
198
|
{
|
199
|
+
"name": "I find all of the .feature files",
|
199
200
|
"args": [
|
200
201
|
|
201
|
-
]
|
202
|
-
"name": "I find all of the .feature files"
|
202
|
+
]
|
203
203
|
}
|
204
204
|
]
|
205
205
|
},
|
206
206
|
{
|
207
|
-
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:59",
|
208
|
-
"flags": "",
|
209
207
|
"source": "^I send each prettified original through the \"([^\"]*)\" machinery$",
|
208
|
+
"flags": "",
|
209
|
+
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:59",
|
210
210
|
"steps": [
|
211
211
|
{
|
212
|
+
"name": "I send each prettified original through the \"json\" machinery",
|
212
213
|
"args": [
|
213
214
|
{
|
214
215
|
"offset": 45,
|
215
216
|
"val": "json"
|
216
217
|
}
|
217
|
-
]
|
218
|
-
"name": "I send each prettified original through the \"json\" machinery"
|
218
|
+
]
|
219
219
|
},
|
220
220
|
{
|
221
|
+
"name": "I send each prettified original through the \"pretty\" machinery",
|
221
222
|
"args": [
|
222
223
|
{
|
223
224
|
"offset": 45,
|
224
225
|
"val": "pretty"
|
225
226
|
}
|
226
|
-
]
|
227
|
-
"name": "I send each prettified original through the \"pretty\" machinery"
|
227
|
+
]
|
228
228
|
}
|
229
229
|
]
|
230
230
|
},
|
231
231
|
{
|
232
|
-
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:83",
|
233
|
-
"flags": "",
|
234
232
|
"source": "^the machinery output should be identical to the prettified original$",
|
233
|
+
"flags": "",
|
234
|
+
"file_colon_line": "features/step_definitions/pretty_formatter_steps.rb:83",
|
235
235
|
"steps": [
|
236
236
|
{
|
237
|
+
"name": "the machinery output should be identical to the prettified original",
|
237
238
|
"args": [
|
238
239
|
|
239
|
-
]
|
240
|
-
"name": "the machinery output should be identical to the prettified original"
|
240
|
+
]
|
241
241
|
}
|
242
242
|
]
|
243
243
|
}
|
@@ -16,13 +16,13 @@ Given /^a JSON formatter$/ do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
Then /^the outputted JSON should be:$/ do |expected_json|
|
19
|
-
require '
|
19
|
+
require 'multi_json'
|
20
20
|
@formatter.done
|
21
21
|
actual_json = @out.string
|
22
22
|
puts actual_json
|
23
|
-
puts
|
24
|
-
expected =
|
25
|
-
actual =
|
23
|
+
puts MultiJson.dump(MultiJson.load(actual_json), :pretty => true)
|
24
|
+
expected = MultiJson.load(expected_json)
|
25
|
+
actual = MultiJson.load(actual_json)
|
26
26
|
actual.should == expected
|
27
27
|
end
|
28
28
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'stringio'
|
2
2
|
require 'gherkin/formatter/pretty_formatter'
|
3
3
|
require 'gherkin/json_parser'
|
4
|
+
require 'multi_json'
|
4
5
|
|
5
6
|
Given /^a PrettyFormatter$/ do
|
6
7
|
@io = StringIO.new
|
@@ -12,7 +13,7 @@ Given /^a JSON lexer$/ do
|
|
12
13
|
end
|
13
14
|
|
14
15
|
Given /^the following JSON is parsed:$/ do |text|
|
15
|
-
@json_parser.parse(
|
16
|
+
@json_parser.parse(MultiJson.dump(MultiJson.load(text), :pretty => true))
|
16
17
|
end
|
17
18
|
|
18
19
|
Then /^the outputted text should be:$/ do |expected_text|
|