gherkin 2.12.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -15
- data/CONTRIBUTING.md +23 -0
- data/Gemfile +0 -3
- data/LICENSE +18 -17
- data/Makefile +65 -0
- data/README.md +9 -268
- data/Rakefile +17 -19
- data/bin/gherkin-generate-ast +21 -0
- data/bin/gherkin-generate-pickles +25 -0
- data/bin/gherkin-generate-tokens +12 -0
- data/gherkin-ruby.razor +218 -0
- data/gherkin.gemspec +22 -76
- data/lib/gherkin/ast_builder.rb +243 -0
- data/lib/gherkin/ast_node.rb +30 -0
- data/lib/gherkin/dialect.rb +58 -0
- data/lib/gherkin/errors.rb +45 -0
- data/lib/gherkin/gherkin-languages.json +2968 -0
- data/lib/gherkin/gherkin_line.rb +95 -0
- data/lib/gherkin/parser.rb +1910 -0
- data/lib/gherkin/pickles/compiler.rb +164 -0
- data/lib/gherkin/token.rb +18 -0
- data/lib/gherkin/token_formatter_builder.rb +39 -0
- data/lib/gherkin/token_matcher.rb +169 -0
- data/lib/gherkin/token_scanner.rb +40 -0
- data/spec/capture_warnings.rb +68 -0
- data/spec/coverage.rb +10 -0
- data/spec/gherkin/parser_spec.rb +146 -0
- metadata +60 -567
- data/.gitattributes +0 -2
- data/.mailmap +0 -2
- data/.rbenv-gemsets +0 -1
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.yardopts +0 -5
- data/History.md +0 -881
- data/build_native_gems.sh +0 -7
- data/cucumber.yml +0 -5
- data/examples/parse_and_output_json.rb +0 -19
- data/ext/gherkin_lexer_ar/extconf.rb +0 -6
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
- data/ext/gherkin_lexer_bg/extconf.rb +0 -6
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
- data/ext/gherkin_lexer_bm/extconf.rb +0 -6
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
- data/ext/gherkin_lexer_ca/extconf.rb +0 -6
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
- data/ext/gherkin_lexer_cs/extconf.rb +0 -6
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
- data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
- data/ext/gherkin_lexer_da/extconf.rb +0 -6
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
- data/ext/gherkin_lexer_de/extconf.rb +0 -6
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
- data/ext/gherkin_lexer_el/extconf.rb +0 -6
- data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
- data/ext/gherkin_lexer_en/extconf.rb +0 -6
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
- data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
- data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
- data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
- data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
- data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
- data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
- data/ext/gherkin_lexer_eo/extconf.rb +0 -6
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
- data/ext/gherkin_lexer_es/extconf.rb +0 -6
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
- data/ext/gherkin_lexer_et/extconf.rb +0 -6
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
- data/ext/gherkin_lexer_fa/extconf.rb +0 -6
- data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
- data/ext/gherkin_lexer_fi/extconf.rb +0 -6
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
- data/ext/gherkin_lexer_fr/extconf.rb +0 -6
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
- data/ext/gherkin_lexer_gl/extconf.rb +0 -6
- data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
- data/ext/gherkin_lexer_he/extconf.rb +0 -6
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
- data/ext/gherkin_lexer_hi/extconf.rb +0 -6
- data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
- data/ext/gherkin_lexer_hr/extconf.rb +0 -6
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
- data/ext/gherkin_lexer_hu/extconf.rb +0 -6
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
- data/ext/gherkin_lexer_id/extconf.rb +0 -6
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
- data/ext/gherkin_lexer_is/extconf.rb +0 -6
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
- data/ext/gherkin_lexer_it/extconf.rb +0 -6
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
- data/ext/gherkin_lexer_ja/extconf.rb +0 -6
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
- data/ext/gherkin_lexer_kn/extconf.rb +0 -6
- data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
- data/ext/gherkin_lexer_ko/extconf.rb +0 -6
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
- data/ext/gherkin_lexer_lt/extconf.rb +0 -6
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
- data/ext/gherkin_lexer_lu/extconf.rb +0 -6
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
- data/ext/gherkin_lexer_lv/extconf.rb +0 -6
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
- data/ext/gherkin_lexer_nl/extconf.rb +0 -6
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
- data/ext/gherkin_lexer_no/extconf.rb +0 -6
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
- data/ext/gherkin_lexer_pa/extconf.rb +0 -6
- data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
- data/ext/gherkin_lexer_pl/extconf.rb +0 -6
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
- data/ext/gherkin_lexer_pt/extconf.rb +0 -6
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
- data/ext/gherkin_lexer_ro/extconf.rb +0 -6
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
- data/ext/gherkin_lexer_ru/extconf.rb +0 -6
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
- data/ext/gherkin_lexer_sk/extconf.rb +0 -6
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
- data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
- data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
- data/ext/gherkin_lexer_sv/extconf.rb +0 -6
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
- data/ext/gherkin_lexer_th/extconf.rb +0 -6
- data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
- data/ext/gherkin_lexer_tl/extconf.rb +0 -6
- data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
- data/ext/gherkin_lexer_tr/extconf.rb +0 -6
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
- data/ext/gherkin_lexer_tt/extconf.rb +0 -6
- data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
- data/ext/gherkin_lexer_uk/extconf.rb +0 -6
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
- data/ext/gherkin_lexer_uz/extconf.rb +0 -6
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
- data/ext/gherkin_lexer_vi/extconf.rb +0 -6
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
- data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
- data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
- data/features/.cucumber/stepdefs.json +0 -244
- data/features/escaped_pipes.feature +0 -8
- data/features/feature_parser.feature +0 -237
- data/features/json_formatter.feature +0 -498
- data/features/json_parser.feature +0 -331
- data/features/native_lexer.feature +0 -19
- data/features/parser_with_native_lexer.feature +0 -205
- data/features/pretty_formatter.feature +0 -17
- data/features/step_definitions/eyeball_steps.rb +0 -3
- data/features/step_definitions/gherkin_steps.rb +0 -29
- data/features/step_definitions/json_formatter_steps.rb +0 -30
- data/features/step_definitions/json_parser_steps.rb +0 -21
- data/features/step_definitions/pretty_formatter_steps.rb +0 -85
- data/features/steps_parser.feature +0 -46
- data/features/support/env.rb +0 -41
- data/install_mingw_os_x.sh +0 -5
- data/js/.npmignore +0 -1
- data/js/lib/gherkin/lexer/.npmignore +0 -0
- data/lib/gherkin.rb +0 -2
- data/lib/gherkin/README.md +0 -7
- data/lib/gherkin/c_lexer.rb +0 -17
- data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
- data/lib/gherkin/formatter/argument.rb +0 -16
- data/lib/gherkin/formatter/escaping.rb +0 -15
- data/lib/gherkin/formatter/filter_formatter.rb +0 -150
- data/lib/gherkin/formatter/hashable.rb +0 -25
- data/lib/gherkin/formatter/json_formatter.rb +0 -133
- data/lib/gherkin/formatter/line_filter.rb +0 -26
- data/lib/gherkin/formatter/model.rb +0 -281
- data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
- data/lib/gherkin/formatter/regexp_filter.rb +0 -21
- data/lib/gherkin/formatter/step_printer.rb +0 -21
- data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
- data/lib/gherkin/formatter/tag_filter.rb +0 -19
- data/lib/gherkin/i18n.json +0 -786
- data/lib/gherkin/i18n.rb +0 -176
- data/lib/gherkin/json_parser.rb +0 -177
- data/lib/gherkin/lexer/ar.rb +0 -1170
- data/lib/gherkin/lexer/bg.rb +0 -1382
- data/lib/gherkin/lexer/bm.rb +0 -1250
- data/lib/gherkin/lexer/ca.rb +0 -1310
- data/lib/gherkin/lexer/cs.rb +0 -1246
- data/lib/gherkin/lexer/cy_gb.rb +0 -1032
- data/lib/gherkin/lexer/da.rb +0 -1048
- data/lib/gherkin/lexer/de.rb +0 -1166
- data/lib/gherkin/lexer/el.rb +0 -1628
- data/lib/gherkin/lexer/en.rb +0 -1156
- data/lib/gherkin/lexer/en_au.rb +0 -1486
- data/lib/gherkin/lexer/en_lol.rb +0 -934
- data/lib/gherkin/lexer/en_old.rb +0 -1037
- data/lib/gherkin/lexer/en_pirate.rb +0 -1210
- data/lib/gherkin/lexer/en_scouse.rb +0 -1362
- data/lib/gherkin/lexer/en_tx.rb +0 -1016
- data/lib/gherkin/lexer/encoding.rb +0 -41
- data/lib/gherkin/lexer/eo.rb +0 -995
- data/lib/gherkin/lexer/es.rb +0 -1140
- data/lib/gherkin/lexer/et.rb +0 -990
- data/lib/gherkin/lexer/fa.rb +0 -1214
- data/lib/gherkin/lexer/fi.rb +0 -969
- data/lib/gherkin/lexer/fr.rb +0 -1228
- data/lib/gherkin/lexer/gl.rb +0 -1117
- data/lib/gherkin/lexer/he.rb +0 -1118
- data/lib/gherkin/lexer/hi.rb +0 -1559
- data/lib/gherkin/lexer/hr.rb +0 -1066
- data/lib/gherkin/lexer/hu.rb +0 -1118
- data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
- data/lib/gherkin/lexer/id.rb +0 -963
- data/lib/gherkin/lexer/is.rb +0 -1120
- data/lib/gherkin/lexer/it.rb +0 -1086
- data/lib/gherkin/lexer/ja.rb +0 -1418
- data/lib/gherkin/lexer/kn.rb +0 -1672
- data/lib/gherkin/lexer/ko.rb +0 -1102
- data/lib/gherkin/lexer/lt.rb +0 -1045
- data/lib/gherkin/lexer/lu.rb +0 -1132
- data/lib/gherkin/lexer/lv.rb +0 -1166
- data/lib/gherkin/lexer/nl.rb +0 -1115
- data/lib/gherkin/lexer/no.rb +0 -1060
- data/lib/gherkin/lexer/pa.rb +0 -1852
- data/lib/gherkin/lexer/pl.rb +0 -1457
- data/lib/gherkin/lexer/pt.rb +0 -1430
- data/lib/gherkin/lexer/ro.rb +0 -1164
- data/lib/gherkin/lexer/ru.rb +0 -1766
- data/lib/gherkin/lexer/sk.rb +0 -1452
- data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
- data/lib/gherkin/lexer/sr_latn.rb +0 -1294
- data/lib/gherkin/lexer/sv.rb +0 -1070
- data/lib/gherkin/lexer/th.rb +0 -2492
- data/lib/gherkin/lexer/tl.rb +0 -1726
- data/lib/gherkin/lexer/tr.rb +0 -1092
- data/lib/gherkin/lexer/tt.rb +0 -1643
- data/lib/gherkin/lexer/uk.rb +0 -1646
- data/lib/gherkin/lexer/uz.rb +0 -1376
- data/lib/gherkin/lexer/vi.rb +0 -1198
- data/lib/gherkin/lexer/zh_cn.rb +0 -1058
- data/lib/gherkin/lexer/zh_tw.rb +0 -1052
- data/lib/gherkin/listener/event.rb +0 -45
- data/lib/gherkin/listener/formatter_listener.rb +0 -150
- data/lib/gherkin/native.rb +0 -7
- data/lib/gherkin/native/java.rb +0 -72
- data/lib/gherkin/native/null.rb +0 -5
- data/lib/gherkin/native/therubyracer.rb +0 -41
- data/lib/gherkin/parser/meta.txt +0 -5
- data/lib/gherkin/parser/parser.rb +0 -166
- data/lib/gherkin/parser/root.txt +0 -11
- data/lib/gherkin/parser/steps.txt +0 -4
- data/lib/gherkin/platform.rb +0 -13
- data/lib/gherkin/rubify.rb +0 -31
- data/lib/gherkin/tag_expression.rb +0 -63
- data/ragel/lexer.c.rl.erb +0 -454
- data/ragel/lexer.java.rl.erb +0 -219
- data/ragel/lexer.js.rl.erb +0 -322
- data/ragel/lexer.rb.rl.erb +0 -179
- data/ragel/lexer_common.rl.erb +0 -50
- data/spec/gherkin/c_lexer_spec.rb +0 -22
- data/spec/gherkin/fixtures/1.feature +0 -8
- data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
- data/spec/gherkin/fixtures/complex.feature +0 -45
- data/spec/gherkin/fixtures/complex.json +0 -139
- data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
- data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
- data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
- data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
- data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
- data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
- data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
- data/spec/gherkin/fixtures/i18n_no.feature +0 -7
- data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
- data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
- data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
- data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
- data/spec/gherkin/fixtures/issue_145.feature +0 -22
- data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
- data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
- data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
- data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
- data/spec/gherkin/fixtures/with_bom.feature +0 -3
- data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
- data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
- data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
- data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
- data/spec/gherkin/formatter/model_spec.rb +0 -28
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
- data/spec/gherkin/formatter/spaces.feature +0 -9
- data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
- data/spec/gherkin/formatter/tabs.feature +0 -9
- data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
- data/spec/gherkin/i18n_spec.rb +0 -256
- data/spec/gherkin/java_lexer_spec.rb +0 -20
- data/spec/gherkin/json_parser_spec.rb +0 -165
- data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
- data/spec/gherkin/native_lexer_spec.rb +0 -29
- data/spec/gherkin/parser/parser_spec.rb +0 -16
- data/spec/gherkin/rubify_spec.rb +0 -23
- data/spec/gherkin/sexp_recorder.rb +0 -59
- data/spec/gherkin/shared/doc_string_group.rb +0 -161
- data/spec/gherkin/shared/encoding_group.rb +0 -48
- data/spec/gherkin/shared/lexer_group.rb +0 -589
- data/spec/gherkin/shared/row_group.rb +0 -123
- data/spec/gherkin/shared/tags_group.rb +0 -52
- data/spec/gherkin/tag_expression_spec.rb +0 -146
- data/spec/spec_helper.rb +0 -94
- data/tasks/apidoc.rake +0 -32
- data/tasks/bench.rake +0 -184
- data/tasks/bench/feature_builder.rb +0 -49
- data/tasks/bench/null_listener.rb +0 -4
- data/tasks/compile.rake +0 -83
- data/tasks/cucumber.rake +0 -23
- data/tasks/gems.rake +0 -46
- data/tasks/ikvm.rake +0 -126
- data/tasks/ragel_task.rb +0 -124
- data/tasks/release.rake +0 -34
- data/tasks/rspec.rake +0 -6
- data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
- data/tasks/yard/default/layout/html/footer.erb +0 -5
- data/tasks/yard/default/layout/html/index.erb +0 -1
- data/tasks/yard/default/layout/html/layout.erb +0 -25
- data/tasks/yard/default/layout/html/logo.erb +0 -1
- data/tasks/yard/default/layout/html/setup.rb +0 -4
@@ -1,204 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'stringio'
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'gherkin/parser/parser'
|
5
|
-
require 'gherkin/formatter/filter_formatter'
|
6
|
-
require 'gherkin/formatter/pretty_formatter'
|
7
|
-
|
8
|
-
module Gherkin
|
9
|
-
module Formatter
|
10
|
-
describe FilterFormatter do
|
11
|
-
attr_accessor :file
|
12
|
-
|
13
|
-
before do
|
14
|
-
self.file = 'complex_for_filtering.feature'
|
15
|
-
end
|
16
|
-
|
17
|
-
def verify_filter(filters, *line_ranges)
|
18
|
-
io = StringIO.new
|
19
|
-
pretty_formatter = Gherkin::Formatter::PrettyFormatter.new(io, true, false)
|
20
|
-
filter_formatter = Gherkin::Formatter::FilterFormatter.new(pretty_formatter, filters)
|
21
|
-
parser = Gherkin::Parser::Parser.new(filter_formatter)
|
22
|
-
|
23
|
-
path = File.dirname(__FILE__) + "/../fixtures/" + file
|
24
|
-
source = File.new(path).read + "# __EOF__"
|
25
|
-
parser.parse(source, path, 0)
|
26
|
-
|
27
|
-
source_lines = source.split("\n")
|
28
|
-
expected = (line_ranges.map do |line_range|
|
29
|
-
source_lines[(line_range.first-1..line_range.last-1)]
|
30
|
-
end.flatten).join("\n").gsub(/# __EOF__/, '')
|
31
|
-
io.string.strip.should == expected.strip
|
32
|
-
end
|
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
|
-
|
42
|
-
context "tags" do
|
43
|
-
it "should filter on feature tag" do
|
44
|
-
verify_filter(['@tag1'], 1..61)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should filter on scenario tag" do
|
48
|
-
verify_filter(['@tag4'], 1..19)
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should filter on abother scenario tag" do
|
52
|
-
verify_filter(['@tag3'], 1..37)
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should filter on scenario outline tag" do
|
56
|
-
verify_filter(['@more'], 1..14, 46..61)
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should filter on first examples tag" do
|
60
|
-
verify_filter(['@neat'], 1..14, 46..55)
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should filter on second examples tag" do
|
64
|
-
verify_filter(['@hamster'], 1..14, 46..49, 56..61)
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should not replay examples from ignored scenario outline" do
|
68
|
-
self.file = 'scenario_outline_with_tags.feature'
|
69
|
-
verify_filter(['~@wip'], 1..2, 12..14)
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should not replay examples from ignored scenario outline" do
|
73
|
-
self.file = 'scenario_outline_with_tags.feature'
|
74
|
-
verify_filter(['~@wip'], 1..2, 12..14)
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should not choke on examples with only header" do
|
78
|
-
self.file = 'examples_with_only_header.feature'
|
79
|
-
verify_filter(['@failing'], 1..7, 12..15)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context "names" do
|
84
|
-
it "should filter on scenario name" do
|
85
|
-
verify_filter([/Reading a Scenario/], 1..19)
|
86
|
-
end
|
87
|
-
|
88
|
-
it "should filter on scenario outline name" do
|
89
|
-
verify_filter([/More/], 1..14, 46..61)
|
90
|
-
end
|
91
|
-
|
92
|
-
it "should filter on first examples name" do
|
93
|
-
verify_filter([/Neato/], 1..14, 46..55)
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should filter on second examples name" do
|
97
|
-
verify_filter([/Rodents/], 1..14, 46..49, 56..61)
|
98
|
-
end
|
99
|
-
|
100
|
-
it "should filter on various names" do
|
101
|
-
self.file = 'hantu_pisang.feature'
|
102
|
-
verify_filter([/Pisang/], 1..8, 19..32)
|
103
|
-
end
|
104
|
-
|
105
|
-
it "should filter on background name" do
|
106
|
-
self.file = 'hantu_pisang.feature'
|
107
|
-
verify_filter([/The background/], 1..5)
|
108
|
-
end
|
109
|
-
|
110
|
-
it "should not choke on examples with only header" do
|
111
|
-
self.file = 'examples_with_only_header.feature'
|
112
|
-
verify_filter([/B/], 1..7, 12..15)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
context "lines" do
|
117
|
-
context "on the same line as feature element keyword" do
|
118
|
-
it "should filter on scenario without line" do
|
119
|
-
self.file = 'scenario_without_steps.feature'
|
120
|
-
verify_filter([3], 1..4)
|
121
|
-
end
|
122
|
-
|
123
|
-
it "should filter on scenario line" do
|
124
|
-
verify_filter([16], 1..19)
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should filter on scenario outline line" do
|
128
|
-
verify_filter([47], 1..14, 46..61)
|
129
|
-
end
|
130
|
-
|
131
|
-
it "should filter on first examples line" do
|
132
|
-
verify_filter([51], 1..14, 46..55)
|
133
|
-
end
|
134
|
-
|
135
|
-
it "should filter on second examples line" do
|
136
|
-
verify_filter([57], 1..14, 46..49, 56..61)
|
137
|
-
end
|
138
|
-
|
139
|
-
it "should not choke on examples with only header" do
|
140
|
-
self.file = 'examples_with_only_header.feature'
|
141
|
-
verify_filter([13], 1..7, 12..15)
|
142
|
-
verify_filter([14], 1..7, 12..15)
|
143
|
-
end
|
144
|
-
|
145
|
-
it "should fix issue 145" do
|
146
|
-
self.file = 'issue_145.feature'
|
147
|
-
verify_filter([14], 1..2, 6..12, 14..14)
|
148
|
-
end
|
149
|
-
|
150
|
-
it "should fix issue 145 more tests" do
|
151
|
-
self.file = 'issue_145.feature'
|
152
|
-
verify_filter([13,15,18], 1..2, 6..13, 15..15, 16..18)
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
context "on the same line as step keyword" do
|
157
|
-
it "should filter on step line" do
|
158
|
-
verify_filter([17], 1..19)
|
159
|
-
end
|
160
|
-
|
161
|
-
it "should filter on scenario outline line" do
|
162
|
-
verify_filter([48], 1..14, 46..61)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
context "on examples header line" do
|
167
|
-
it "should filter on first table" do
|
168
|
-
verify_filter([52], 1..14, 46..55)
|
169
|
-
end
|
170
|
-
|
171
|
-
it "should filter on second table" do
|
172
|
-
verify_filter([58], 1..14, 46..49, 56..61)
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
context "on examples example line" do
|
177
|
-
it "should filter on first table" do
|
178
|
-
verify_filter([53], 1..14, 46..53, 55..55)
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
context "on tag line" do
|
183
|
-
it "should filter on first tag" do
|
184
|
-
verify_filter([15], 1..19)
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
context "multiline argument" do
|
189
|
-
it "should filter on table line" do
|
190
|
-
verify_filter([36], 1..14, 20..37)
|
191
|
-
end
|
192
|
-
|
193
|
-
it "should filter on first pystring quote" do
|
194
|
-
verify_filter([41], 1..14, 38..45)
|
195
|
-
end
|
196
|
-
|
197
|
-
it "should filter on last pystring quote" do
|
198
|
-
verify_filter([44], 1..14, 38..45)
|
199
|
-
end
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|
204
|
-
end
|
@@ -1,179 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'gherkin/formatter/json_formatter'
|
3
|
-
require 'gherkin/formatter/model'
|
4
|
-
require 'multi_json'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
module Gherkin
|
8
|
-
module Formatter
|
9
|
-
describe JSONFormatter do
|
10
|
-
it "renders results" do
|
11
|
-
io = StringIO.new
|
12
|
-
f = JSONFormatter.new(io)
|
13
|
-
f.uri("f.feature")
|
14
|
-
f.feature(Model::Feature.new([], [], "Feature", "ff", "", 1, "ff"))
|
15
|
-
f.scenario(Model::Scenario.new([], [], "Scenario", "ss", "", 2, "ff/ss"))
|
16
|
-
|
17
|
-
f.step(Model::Step.new([], "Given ", "g", 3, nil, nil))
|
18
|
-
f.match(Model::Match.new([], "def.rb:33"))
|
19
|
-
data = "abc"
|
20
|
-
if defined?(JRUBY_VERSION)
|
21
|
-
data = data.to_java_bytes
|
22
|
-
end
|
23
|
-
f.embedding("mime-type", data)
|
24
|
-
f.write("step output")
|
25
|
-
|
26
|
-
f.result(Model::Result.new(:passed, 1, nil))
|
27
|
-
|
28
|
-
f.step(Model::Step.new([], "When ", "w", 4, nil, nil))
|
29
|
-
f.match(Model::Match.new([], "def.rb:44"))
|
30
|
-
f.result(Model::Result.new(:passed, 1, nil))
|
31
|
-
|
32
|
-
f.after(Model::Match.new([], "def.rb:55"), Model::Result.new(:passed, 22, nil))
|
33
|
-
|
34
|
-
f.eof
|
35
|
-
f.done
|
36
|
-
|
37
|
-
expected = %{
|
38
|
-
[
|
39
|
-
{
|
40
|
-
"id": "ff",
|
41
|
-
"uri": "f.feature",
|
42
|
-
"keyword": "Feature",
|
43
|
-
"name": "ff",
|
44
|
-
"line": 1,
|
45
|
-
"description": "",
|
46
|
-
"elements": [
|
47
|
-
{
|
48
|
-
"id": "ff/ss",
|
49
|
-
"keyword": "Scenario",
|
50
|
-
"name": "ss",
|
51
|
-
"line": 2,
|
52
|
-
"description": "",
|
53
|
-
"type": "scenario",
|
54
|
-
"steps": [
|
55
|
-
{
|
56
|
-
"keyword": "Given ",
|
57
|
-
"name": "g",
|
58
|
-
"line": 3,
|
59
|
-
"match": {
|
60
|
-
"location": "def.rb:33"
|
61
|
-
},
|
62
|
-
"embeddings": [
|
63
|
-
{
|
64
|
-
"mime_type": "mime-type",
|
65
|
-
"data": "YWJj"
|
66
|
-
}
|
67
|
-
],
|
68
|
-
"output": [
|
69
|
-
"step output"
|
70
|
-
],
|
71
|
-
"result": {
|
72
|
-
"status": "passed",
|
73
|
-
"duration": 1
|
74
|
-
}
|
75
|
-
},
|
76
|
-
{
|
77
|
-
"keyword": "When ",
|
78
|
-
"name": "w",
|
79
|
-
"line": 4,
|
80
|
-
"match": {
|
81
|
-
"location": "def.rb:44"
|
82
|
-
},
|
83
|
-
"result": {
|
84
|
-
"status": "passed",
|
85
|
-
"duration": 1
|
86
|
-
}
|
87
|
-
}
|
88
|
-
],
|
89
|
-
"after": [
|
90
|
-
{
|
91
|
-
"match":{
|
92
|
-
"location":"def.rb:55"
|
93
|
-
},
|
94
|
-
"result":{
|
95
|
-
"status":"passed",
|
96
|
-
"duration": 22
|
97
|
-
}
|
98
|
-
}
|
99
|
-
]
|
100
|
-
}
|
101
|
-
]
|
102
|
-
}
|
103
|
-
]
|
104
|
-
}
|
105
|
-
MultiJson.load(io.string).should == MultiJson.load(expected)
|
106
|
-
end
|
107
|
-
|
108
|
-
it "renders results as pretty json" do
|
109
|
-
io = StringIO.new
|
110
|
-
f = JSONFormatter.new(io)
|
111
|
-
f.uri("f.feature")
|
112
|
-
f.feature(Model::Feature.new([], [], "Feature", nil, nil, nil, nil))
|
113
|
-
f.eof
|
114
|
-
f.done
|
115
|
-
|
116
|
-
expected = %{
|
117
|
-
[
|
118
|
-
{
|
119
|
-
"keyword": "Feature",
|
120
|
-
"uri": "f.feature"
|
121
|
-
}
|
122
|
-
]
|
123
|
-
}
|
124
|
-
io.string.should == MultiJson.dump(MultiJson.load(expected), :pretty => true)
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'supports append_duration' do
|
128
|
-
io = StringIO.new
|
129
|
-
f = JSONFormatter.new(io)
|
130
|
-
f.uri("f.feature")
|
131
|
-
f.feature(Model::Feature.new([], [], "Feature", "ff", "", 1, "ff"))
|
132
|
-
f.scenario(Model::Scenario.new([], [], "Scenario", "ss", "", 2, "ff/ss"))
|
133
|
-
f.step(Model::Step.new([], "Given ", "g", 3, nil, nil))
|
134
|
-
f.match(Model::Match.new([], "def.rb:33"))
|
135
|
-
f.result(Model::Result.new(:passed, 3, nil))
|
136
|
-
f.append_duration(1)
|
137
|
-
f.eof
|
138
|
-
f.done
|
139
|
-
expected = %{
|
140
|
-
[
|
141
|
-
{
|
142
|
-
"id": "ff",
|
143
|
-
"uri": "f.feature",
|
144
|
-
"keyword": "Feature",
|
145
|
-
"name": "ff",
|
146
|
-
"line": 1,
|
147
|
-
"description": "",
|
148
|
-
"elements": [
|
149
|
-
{
|
150
|
-
"id": "ff/ss",
|
151
|
-
"keyword": "Scenario",
|
152
|
-
"name": "ss",
|
153
|
-
"line": 2,
|
154
|
-
"description": "",
|
155
|
-
"type": "scenario",
|
156
|
-
"steps": [
|
157
|
-
{
|
158
|
-
"keyword": "Given ",
|
159
|
-
"name": "g",
|
160
|
-
"line": 3,
|
161
|
-
"match": {
|
162
|
-
"location": "def.rb:33"
|
163
|
-
},
|
164
|
-
"result": {
|
165
|
-
"status": "passed",
|
166
|
-
"duration": 1000000000
|
167
|
-
}
|
168
|
-
}
|
169
|
-
]
|
170
|
-
}
|
171
|
-
]
|
172
|
-
}
|
173
|
-
]
|
174
|
-
}
|
175
|
-
MultiJson.load(io.string).should == MultiJson.load(expected)
|
176
|
-
end
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'gherkin/formatter/model'
|
3
|
-
require 'gherkin/formatter/argument'
|
4
|
-
|
5
|
-
module Gherkin
|
6
|
-
module Formatter
|
7
|
-
module Model
|
8
|
-
describe Tag do
|
9
|
-
it "should be equal when name is equal" do
|
10
|
-
tags = [Tag.new('@x', 1), Tag.new('@y', 2), Tag.new('@x', 3)]
|
11
|
-
tags.to_a.uniq.length.should == 2
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe Step do
|
16
|
-
it "should provide arguments for outline tokens" do
|
17
|
-
step = Step.new([], 'Given ', "I have <number> cukes in <whose> belly", 10, nil, nil)
|
18
|
-
step.outline_args.map{|arg| [arg.offset, arg.val]}.should == [[7, "<number>"], [25, "<whose>"]]
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should provide no arguments when there are no outline tokens" do
|
22
|
-
step = Step.new([], 'Given ', "I have 33 cukes in my belly", 10, nil, nil)
|
23
|
-
step.outline_args.to_a.should == []
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,184 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'gherkin/formatter/pretty_formatter'
|
4
|
-
require 'gherkin/formatter/argument'
|
5
|
-
require 'gherkin/formatter/model'
|
6
|
-
require 'gherkin/listener/formatter_listener'
|
7
|
-
require 'gherkin/parser/parser'
|
8
|
-
require 'stringio'
|
9
|
-
|
10
|
-
module Gherkin
|
11
|
-
module Formatter
|
12
|
-
describe PrettyFormatter do
|
13
|
-
include AnsiEscapes
|
14
|
-
|
15
|
-
def assert_io_include(s)
|
16
|
-
actual = @io.string
|
17
|
-
actual.gsub!(/\e\[m/, "\e[0m") # JANSI resets without the 0.
|
18
|
-
actual.should include(s)
|
19
|
-
end
|
20
|
-
|
21
|
-
def assert_pretty(input, expected_output=input)
|
22
|
-
[true, false].each do |force_ruby|
|
23
|
-
io = StringIO.new
|
24
|
-
pf = Gherkin::Formatter::PrettyFormatter.new(io, true, false)
|
25
|
-
parser = Gherkin::Parser::Parser.new(pf, true, "root", force_ruby)
|
26
|
-
parser.parse(input, "test.feature", 0)
|
27
|
-
output = io.string
|
28
|
-
output.should == expected_output
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
before do
|
33
|
-
@io = StringIO.new
|
34
|
-
@f = Gherkin::Formatter::PrettyFormatter.new(@io, false, true)
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should print comments when scenario is longer" do
|
38
|
-
@f.uri("features/foo.feature")
|
39
|
-
@f.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1, "hello"))
|
40
|
-
|
41
|
-
@f.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4, "the-scenario"))
|
42
|
-
@f.step(Model::Step.new([], "Given ", "some stuff", 5, nil, nil))
|
43
|
-
@f.step(Model::Step.new([], "When ", "foo", 6, nil, nil))
|
44
|
-
|
45
|
-
@f.match(Model::Match.new([], "features/step_definitions/bar.rb:56"))
|
46
|
-
@f.result(Model::Result.new('passed', 22, nil))
|
47
|
-
|
48
|
-
@f.match(Model::Match.new([], "features/step_definitions/bar.rb:96"))
|
49
|
-
@f.result(Model::Result.new('passed', 33, nil))
|
50
|
-
|
51
|
-
@f.eof()
|
52
|
-
|
53
|
-
assert_io_include(%{Feature: Hello
|
54
|
-
World
|
55
|
-
|
56
|
-
Scenario: The scenario #{comments}# features/foo.feature:4#{reset}
|
57
|
-
})
|
58
|
-
assert_io_include(%{ #{passed}Given #{reset}#{passed}some stuff#{reset} #{comments}# features/step_definitions/bar.rb:56#{reset}
|
59
|
-
})
|
60
|
-
assert_io_include(%{ #{passed}When #{reset}#{passed}foo#{reset} #{comments}# features/step_definitions/bar.rb:96#{reset}
|
61
|
-
})
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should print comments when step is longer" do
|
65
|
-
@f.uri("features/foo.feature")
|
66
|
-
@f.feature(Model::Feature.new([], [], "Feature", "Hello", "World", 1, "hello"))
|
67
|
-
step = Model::Step.new([], "Given ", "some stuff that is longer", 5, nil, nil)
|
68
|
-
match = Model::Match.new([], "features/step_definitions/bar.rb:56")
|
69
|
-
result = Model::Result.new('passed', 0, nil)
|
70
|
-
|
71
|
-
@f.scenario(Model::Scenario.new([], [], "Scenario", "The scenario", "", 4, "the-scenario"))
|
72
|
-
@f.step(step)
|
73
|
-
@f.match(match)
|
74
|
-
@f.result(result)
|
75
|
-
|
76
|
-
@f.eof()
|
77
|
-
|
78
|
-
assert_io_include(%{Feature: Hello
|
79
|
-
World
|
80
|
-
|
81
|
-
Scenario: The scenario #{comments}# features/foo.feature:4#{reset}
|
82
|
-
})
|
83
|
-
assert_io_include(%{ #{passed}Given #{reset}#{passed}some stuff that is longer#{reset} #{comments}# features/step_definitions/bar.rb:56#{reset}
|
84
|
-
})
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should highlight arguments for regular steps" do
|
88
|
-
@f.uri("foo.feature")
|
89
|
-
@f.scenario(Model::Scenario.new([], [], "Scenario", "Lots of cukes", "", 3, "lots-of-cukes"))
|
90
|
-
@f.step(Model::Step.new([], "Given ", "I have 999 cukes in my belly", 3, nil, nil))
|
91
|
-
@f.match(Model::Match.new([Gherkin::Formatter::Argument.new(7, '999')], nil))
|
92
|
-
@f.result(Model::Result.new('passed', 6, nil))
|
93
|
-
@f.eof()
|
94
|
-
|
95
|
-
assert_io_include(
|
96
|
-
"\n" +
|
97
|
-
" Scenario: Lots of cukes \e[90m# foo.feature:3\e[0m\n")
|
98
|
-
assert_io_include(
|
99
|
-
" #{passed}Given #{reset}#{passed}I have #{reset}#{passed_arg}999#{reset}#{passed} cukes in my belly#{reset}\n"
|
100
|
-
)
|
101
|
-
end
|
102
|
-
|
103
|
-
# See https://github.com/cucumber/gherkin/pull/171
|
104
|
-
it "should highlight arguments when there are optional arguments" do
|
105
|
-
@f.uri("foo.feature")
|
106
|
-
@f.scenario(Model::Scenario.new([], [], "Scenario", "Lots of cukes", "", 3, "lots-of-cukes"))
|
107
|
-
@f.step(Model::Step.new([], "Given ", "I have 999 cukes in my belly", 3, nil, nil))
|
108
|
-
@f.match(Model::Match.new([
|
109
|
-
Gherkin::Formatter::Argument.new(nil, nil), # An optional argument
|
110
|
-
Gherkin::Formatter::Argument.new(7, '999')
|
111
|
-
], nil))
|
112
|
-
@f.result(Model::Result.new('passed', 6, nil))
|
113
|
-
@f.eof()
|
114
|
-
|
115
|
-
assert_io_include(
|
116
|
-
"\n" +
|
117
|
-
" Scenario: Lots of cukes \e[90m# foo.feature:3\e[0m\n"
|
118
|
-
)
|
119
|
-
assert_io_include(
|
120
|
-
" #{passed}Given #{reset}#{passed}I have #{reset}#{passed_arg}999#{reset}#{passed} cukes in my belly#{reset}\n"
|
121
|
-
)
|
122
|
-
end
|
123
|
-
|
124
|
-
it "should prettify scenario" do
|
125
|
-
assert_pretty(%{Feature: Feature Description
|
126
|
-
Some preamble
|
127
|
-
|
128
|
-
Scenario: Scenario Description
|
129
|
-
description has multiple lines
|
130
|
-
|
131
|
-
Given there is a step
|
132
|
-
"""
|
133
|
-
with
|
134
|
-
pystrings
|
135
|
-
"""
|
136
|
-
And there is another step
|
137
|
-
| æ | \\|o |
|
138
|
-
| \\|a | ø\\\\ |
|
139
|
-
Then we will see steps
|
140
|
-
})
|
141
|
-
end
|
142
|
-
|
143
|
-
|
144
|
-
it "should prettify scenario outline with table" do
|
145
|
-
assert_pretty(%{# A feature comment
|
146
|
-
@foo
|
147
|
-
Feature: Feature Description
|
148
|
-
Some preamble
|
149
|
-
on several
|
150
|
-
lines
|
151
|
-
|
152
|
-
# A Scenario Outline comment
|
153
|
-
@bar
|
154
|
-
Scenario Outline: Scenario Ouline Description
|
155
|
-
Given there is a
|
156
|
-
"""
|
157
|
-
string with <foo>
|
158
|
-
"""
|
159
|
-
And a table with
|
160
|
-
| <bar> |
|
161
|
-
| <baz> |
|
162
|
-
|
163
|
-
@zap @boing
|
164
|
-
Examples: Examples Description
|
165
|
-
| foo | bar | baz |
|
166
|
-
| Banana | I | am hungry |
|
167
|
-
| Beer | You | are thirsty |
|
168
|
-
| Bed | They | are tired |
|
169
|
-
})
|
170
|
-
end
|
171
|
-
|
172
|
-
it "should preserve tabs" do
|
173
|
-
assert_pretty(IO.read(File.dirname(__FILE__) + '/tabs.feature'), IO.read(File.dirname(__FILE__) + '/spaces.feature'))
|
174
|
-
end
|
175
|
-
|
176
|
-
it "should escape backslashes and pipes" do
|
177
|
-
io = StringIO.new
|
178
|
-
f = Gherkin::Formatter::PrettyFormatter.new(io, true, false)
|
179
|
-
f.__send__(:table, [Gherkin::Formatter::Model::DataTableRow.new([], ['|', '\\'], 1)])
|
180
|
-
io.string.should == ' | \\| | \\\\ |' + "\n"
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
184
|
-
end
|