gherkin 1.0.25-i386-mswin32 → 1.0.26-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,2 @@
1
1
  spec/gherkin/fixtures/dos_line_endings.feature -crlf
2
+ spec/gherkin/fixtures/with_bom.feature -crlf
@@ -1,3 +1,8 @@
1
+ == 1.0.26 (2010-05-09)
2
+
3
+ === New Features
4
+ * Ignore the BOM that many retarded Windows editors insist on sticking in the beginning of a file. (Aslak Hellesøy)
5
+
1
6
  == 1.0.25 (2010-05-02)
2
7
 
3
8
  === Bugfixes
@@ -2,4 +2,4 @@
2
2
  :major: 1
3
3
  :minor: 0
4
4
  :build:
5
- :patch: 25
5
+ :patch: 26
@@ -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
  }%%
@@ -0,0 +1,3 @@
1
+ Feature: Feature Text
2
+ Scenario: Reading a Scenario
3
+ Given there is a step
@@ -477,48 +477,56 @@ Given I am a step
477
477
  end
478
478
  end
479
479
 
480
- context "DOS line endings" do
481
- describe "A complex feature with tags, comments, multiple scenarios, and multiple steps and tables" do
482
- it "should find things in the right order" do
483
- scan_file("dos_line_endings.feature")
484
- @listener.to_sexp.should == [
485
- [:comment, "#Comment on line 1", 1],
486
- [:comment, "#Comment on line 2", 2],
487
- [:tag, "@tag1", 3],
488
- [:tag, "@tag2", 3],
489
- [: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],
490
- [:comment, "#Comment on line 9", 9],
491
- [:comment, "#Comment on line 11", 11],
492
- [:background, "Background", "", 13],
493
- [:step, "Given ", "this is a background step", 14],
494
- [:step, "And ", "this is another one", 15],
495
- [:tag, "@tag3", 17],
496
- [:tag, "@tag4", 17],
497
- [:scenario, "Scenario", "Reading a Scenario", 18],
498
- [:step, "Given ", "there is a step", 19],
499
- [:step, "But ", "not another step", 20],
500
- [:tag, "@tag3", 22],
501
- [:scenario, "Scenario", "Reading a second scenario\r\nWith two lines of text", 23],
502
- [:comment, "#Comment on line 24", 25],
503
- [:step, "Given ", "a third step with a table", 26],
504
- [:row, %w{a b}, 27],
505
- [:row, %w{c d}, 28],
506
- [:row, %w{e f}, 29],
507
- [:step, "And ", "I am still testing things", 30],
508
- [:row, %w{g h}, 31],
509
- [:row, %w{e r}, 32],
510
- [:row, %w{k i}, 33],
511
- [:row, ['n', ''], 34],
512
- [:step, "And ", "I am done testing these tables", 35],
513
- [:comment, "#Comment on line 29", 36],
514
- [:step, "Then ", "I am happy", 37],
515
- [:scenario, "Scenario", "Hammerzeit", 39],
516
- [:step, "Given ", "All work and no play", 40],
517
- [:py_string, "Makes Homer something something\r\nAnd something else", 41],
518
- [:step, "Then ", "crazy", 45],
519
- [:eof]
520
- ]
521
- end
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
- - 25
9
- version: 1.0.25
8
+ - 26
9
+ version: 1.0.26
10
10
  platform: i386-mswin32
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
@@ -1,3 +0,0 @@
1
- Feature: Feature Text
2
- Scenario: Reading a Scenario
3
- Given there is a step