gherkin 1.0.25-i386-mingw32 → 1.0.26-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/.gitattributes +1 -0
- data/History.txt +5 -0
- data/VERSION.yml +1 -1
- data/ragel/lexer_common.rl.erb +2 -1
- data/spec/gherkin/fixtures/with_bom.feature +3 -0
- data/spec/gherkin/shared/lexer_spec.rb +50 -42
- metadata +3 -3
- data/spec/gherkin/fixtures/simple.feature +0 -3
data/.gitattributes
CHANGED
data/History.txt
CHANGED
data/VERSION.yml
CHANGED
data/ragel/lexer_common.rl.erb
CHANGED
@@ -39,8 +39,9 @@
|
|
39
39
|
StartPyString = '"""' >start_pystring space* :>> EOL;
|
40
40
|
EndPyString = (space* '"""') >next_keyword_start;
|
41
41
|
PyString = space* StartPyString %begin_pystring_content (^EOL | EOL)* :>> EndPyString %store_pystring_content space* EOL+;
|
42
|
+
BOM = 0xEF 0xBB 0xBF; # http://en.wikipedia.org/wiki/Byte_order_mark
|
42
43
|
|
43
|
-
Tokens = (space | EOL)* (Tags | Comment | FeatureHeading | BackgroundHeading | ScenarioHeading | ScenarioOutlineHeading | ExamplesHeading | Step | Row | PyString)* (space | EOL)* EOF;
|
44
|
+
Tokens = BOM? (space | EOL)* (Tags | Comment | FeatureHeading | BackgroundHeading | ScenarioHeading | ScenarioOutlineHeading | ExamplesHeading | Step | Row | PyString)* (space | EOL)* EOF;
|
44
45
|
|
45
46
|
main := Tokens %end_feature @!end_feature;
|
46
47
|
}%%
|
@@ -477,48 +477,56 @@ Given I am a step
|
|
477
477
|
end
|
478
478
|
end
|
479
479
|
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
480
|
+
describe "Windows stuff" do
|
481
|
+
it "should find things in the right order for CRLF features" do
|
482
|
+
scan_file("dos_line_endings.feature")
|
483
|
+
@listener.to_sexp.should == [
|
484
|
+
[:comment, "#Comment on line 1", 1],
|
485
|
+
[:comment, "#Comment on line 2", 2],
|
486
|
+
[:tag, "@tag1", 3],
|
487
|
+
[:tag, "@tag2", 3],
|
488
|
+
[:feature, "Feature", "Feature Text\r\nIn order to test multiline forms\r\nAs a ragel writer\r\nI need to check for complex combinations", 4],
|
489
|
+
[:comment, "#Comment on line 9", 9],
|
490
|
+
[:comment, "#Comment on line 11", 11],
|
491
|
+
[:background, "Background", "", 13],
|
492
|
+
[:step, "Given ", "this is a background step", 14],
|
493
|
+
[:step, "And ", "this is another one", 15],
|
494
|
+
[:tag, "@tag3", 17],
|
495
|
+
[:tag, "@tag4", 17],
|
496
|
+
[:scenario, "Scenario", "Reading a Scenario", 18],
|
497
|
+
[:step, "Given ", "there is a step", 19],
|
498
|
+
[:step, "But ", "not another step", 20],
|
499
|
+
[:tag, "@tag3", 22],
|
500
|
+
[:scenario, "Scenario", "Reading a second scenario\r\nWith two lines of text", 23],
|
501
|
+
[:comment, "#Comment on line 24", 25],
|
502
|
+
[:step, "Given ", "a third step with a table", 26],
|
503
|
+
[:row, %w{a b}, 27],
|
504
|
+
[:row, %w{c d}, 28],
|
505
|
+
[:row, %w{e f}, 29],
|
506
|
+
[:step, "And ", "I am still testing things", 30],
|
507
|
+
[:row, %w{g h}, 31],
|
508
|
+
[:row, %w{e r}, 32],
|
509
|
+
[:row, %w{k i}, 33],
|
510
|
+
[:row, ['n', ''], 34],
|
511
|
+
[:step, "And ", "I am done testing these tables", 35],
|
512
|
+
[:comment, "#Comment on line 29", 36],
|
513
|
+
[:step, "Then ", "I am happy", 37],
|
514
|
+
[:scenario, "Scenario", "Hammerzeit", 39],
|
515
|
+
[:step, "Given ", "All work and no play", 40],
|
516
|
+
[:py_string, "Makes Homer something something\r\nAnd something else", 41],
|
517
|
+
[:step, "Then ", "crazy", 45],
|
518
|
+
[:eof]
|
519
|
+
]
|
520
|
+
end
|
521
|
+
|
522
|
+
it "should cope with the retarded BOM that many Windows editors insert at the beginning of a file" do
|
523
|
+
scan_file("with_bom.feature")
|
524
|
+
@listener.to_sexp.should == [
|
525
|
+
[:feature, "Feature", "Feature Text", 1],
|
526
|
+
[:scenario, "Scenario", "Reading a Scenario", 2],
|
527
|
+
[:step, "Given ", "there is a step", 3],
|
528
|
+
[:eof]
|
529
|
+
]
|
522
530
|
end
|
523
531
|
end
|
524
532
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 26
|
9
|
+
version: 1.0.26
|
10
10
|
platform: i386-mingw32
|
11
11
|
authors:
|
12
12
|
- Mike Sassak
|
@@ -234,9 +234,9 @@ files:
|
|
234
234
|
- spec/gherkin/fixtures/i18n_fr.feature
|
235
235
|
- spec/gherkin/fixtures/i18n_no.feature
|
236
236
|
- spec/gherkin/fixtures/i18n_zh-CN.feature
|
237
|
-
- spec/gherkin/fixtures/simple.feature
|
238
237
|
- spec/gherkin/fixtures/simple_with_comments.feature
|
239
238
|
- spec/gherkin/fixtures/simple_with_tags.feature
|
239
|
+
- spec/gherkin/fixtures/with_bom.feature
|
240
240
|
- spec/gherkin/formatter/argument_spec.rb
|
241
241
|
- spec/gherkin/formatter/colors_spec.rb
|
242
242
|
- spec/gherkin/formatter/pretty_formatter_spec.rb
|