bryanl-gherkin 2.11.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. data/.gitattributes +2 -0
  2. data/.mailmap +2 -0
  3. data/.rbenv-gemsets +1 -0
  4. data/.rspec +1 -0
  5. data/.rvmrc +1 -0
  6. data/.travis.yml +16 -0
  7. data/.yardopts +5 -0
  8. data/Gemfile +5 -0
  9. data/History.md +788 -0
  10. data/LICENSE +20 -0
  11. data/README.md +272 -0
  12. data/Rakefile +26 -0
  13. data/build_native_gems.sh +7 -0
  14. data/cucumber.yml +4 -0
  15. data/examples/parse_and_output_json.rb +19 -0
  16. data/features/.cucumber/stepdefs.json +244 -0
  17. data/features/escaped_pipes.feature +8 -0
  18. data/features/feature_parser.feature +237 -0
  19. data/features/json_formatter.feature +498 -0
  20. data/features/json_parser.feature +331 -0
  21. data/features/native_lexer.feature +19 -0
  22. data/features/parser_with_native_lexer.feature +205 -0
  23. data/features/pretty_formatter.feature +16 -0
  24. data/features/step_definitions/eyeball_steps.rb +3 -0
  25. data/features/step_definitions/gherkin_steps.rb +29 -0
  26. data/features/step_definitions/json_formatter_steps.rb +30 -0
  27. data/features/step_definitions/json_parser_steps.rb +20 -0
  28. data/features/step_definitions/pretty_formatter_steps.rb +85 -0
  29. data/features/steps_parser.feature +46 -0
  30. data/features/support/env.rb +42 -0
  31. data/gherkin.gemspec +77 -0
  32. data/install_mingw_os_x.sh +7 -0
  33. data/js/.npmignore +1 -0
  34. data/js/lib/gherkin/lexer/.npmignore +0 -0
  35. data/lib/gherkin.rb +2 -0
  36. data/lib/gherkin/c_lexer.rb +17 -0
  37. data/lib/gherkin/formatter/ansi_escapes.rb +97 -0
  38. data/lib/gherkin/formatter/argument.rb +16 -0
  39. data/lib/gherkin/formatter/escaping.rb +15 -0
  40. data/lib/gherkin/formatter/filter_formatter.rb +146 -0
  41. data/lib/gherkin/formatter/hashable.rb +19 -0
  42. data/lib/gherkin/formatter/json_formatter.rb +122 -0
  43. data/lib/gherkin/formatter/line_filter.rb +26 -0
  44. data/lib/gherkin/formatter/model.rb +281 -0
  45. data/lib/gherkin/formatter/pretty_formatter.rb +244 -0
  46. data/lib/gherkin/formatter/regexp_filter.rb +21 -0
  47. data/lib/gherkin/formatter/step_printer.rb +21 -0
  48. data/lib/gherkin/formatter/tag_count_formatter.rb +47 -0
  49. data/lib/gherkin/formatter/tag_filter.rb +19 -0
  50. data/lib/gherkin/i18n.rb +180 -0
  51. data/lib/gherkin/i18n.yml +613 -0
  52. data/lib/gherkin/js_lexer.rb +20 -0
  53. data/lib/gherkin/json_parser.rb +177 -0
  54. data/lib/gherkin/lexer/i18n_lexer.rb +46 -0
  55. data/lib/gherkin/listener/event.rb +45 -0
  56. data/lib/gherkin/listener/formatter_listener.rb +143 -0
  57. data/lib/gherkin/native.rb +7 -0
  58. data/lib/gherkin/native/java.rb +72 -0
  59. data/lib/gherkin/native/null.rb +5 -0
  60. data/lib/gherkin/native/therubyracer.rb +39 -0
  61. data/lib/gherkin/parser/meta.txt +5 -0
  62. data/lib/gherkin/parser/parser.rb +164 -0
  63. data/lib/gherkin/parser/root.txt +11 -0
  64. data/lib/gherkin/parser/steps.txt +4 -0
  65. data/lib/gherkin/rb_lexer.rb +8 -0
  66. data/lib/gherkin/rb_lexer/README.rdoc +8 -0
  67. data/lib/gherkin/rb_lexer/ar.rb +1165 -0
  68. data/lib/gherkin/rb_lexer/bg.rb +1377 -0
  69. data/lib/gherkin/rb_lexer/bm.rb +1081 -0
  70. data/lib/gherkin/rb_lexer/ca.rb +1305 -0
  71. data/lib/gherkin/rb_lexer/cs.rb +1157 -0
  72. data/lib/gherkin/rb_lexer/cy_gb.rb +1027 -0
  73. data/lib/gherkin/rb_lexer/da.rb +1043 -0
  74. data/lib/gherkin/rb_lexer/de.rb +1151 -0
  75. data/lib/gherkin/rb_lexer/en.rb +1151 -0
  76. data/lib/gherkin/rb_lexer/en_au.rb +971 -0
  77. data/lib/gherkin/rb_lexer/en_lol.rb +929 -0
  78. data/lib/gherkin/rb_lexer/en_pirate.rb +1205 -0
  79. data/lib/gherkin/rb_lexer/en_scouse.rb +1357 -0
  80. data/lib/gherkin/rb_lexer/en_tx.rb +1011 -0
  81. data/lib/gherkin/rb_lexer/eo.rb +990 -0
  82. data/lib/gherkin/rb_lexer/es.rb +1135 -0
  83. data/lib/gherkin/rb_lexer/et.rb +985 -0
  84. data/lib/gherkin/rb_lexer/fi.rb +964 -0
  85. data/lib/gherkin/rb_lexer/fr.rb +1223 -0
  86. data/lib/gherkin/rb_lexer/he.rb +1113 -0
  87. data/lib/gherkin/rb_lexer/hr.rb +1061 -0
  88. data/lib/gherkin/rb_lexer/hu.rb +1113 -0
  89. data/lib/gherkin/rb_lexer/id.rb +958 -0
  90. data/lib/gherkin/rb_lexer/is.rb +1115 -0
  91. data/lib/gherkin/rb_lexer/it.rb +1081 -0
  92. data/lib/gherkin/rb_lexer/ja.rb +1413 -0
  93. data/lib/gherkin/rb_lexer/ko.rb +1097 -0
  94. data/lib/gherkin/rb_lexer/lt.rb +1040 -0
  95. data/lib/gherkin/rb_lexer/lu.rb +1127 -0
  96. data/lib/gherkin/rb_lexer/lv.rb +1161 -0
  97. data/lib/gherkin/rb_lexer/nl.rb +1110 -0
  98. data/lib/gherkin/rb_lexer/no.rb +1055 -0
  99. data/lib/gherkin/rb_lexer/pl.rb +1452 -0
  100. data/lib/gherkin/rb_lexer/pt.rb +1425 -0
  101. data/lib/gherkin/rb_lexer/ro.rb +1159 -0
  102. data/lib/gherkin/rb_lexer/ru.rb +1749 -0
  103. data/lib/gherkin/rb_lexer/sk.rb +1041 -0
  104. data/lib/gherkin/rb_lexer/sr_cyrl.rb +1798 -0
  105. data/lib/gherkin/rb_lexer/sr_latn.rb +1289 -0
  106. data/lib/gherkin/rb_lexer/sv.rb +1065 -0
  107. data/lib/gherkin/rb_lexer/tr.rb +1087 -0
  108. data/lib/gherkin/rb_lexer/uk.rb +1641 -0
  109. data/lib/gherkin/rb_lexer/uz.rb +1371 -0
  110. data/lib/gherkin/rb_lexer/vi.rb +1193 -0
  111. data/lib/gherkin/rb_lexer/zh_cn.rb +1053 -0
  112. data/lib/gherkin/rb_lexer/zh_tw.rb +1047 -0
  113. data/lib/gherkin/rubify.rb +24 -0
  114. data/lib/gherkin/tag_expression.rb +62 -0
  115. data/ragel/lexer.c.rl.erb +454 -0
  116. data/ragel/lexer.java.rl.erb +219 -0
  117. data/ragel/lexer.js.rl.erb +227 -0
  118. data/ragel/lexer.rb.rl.erb +174 -0
  119. data/ragel/lexer_common.rl.erb +50 -0
  120. data/spec/gherkin/c_lexer_spec.rb +22 -0
  121. data/spec/gherkin/fixtures/1.feature +8 -0
  122. data/spec/gherkin/fixtures/comments_in_table.feature +9 -0
  123. data/spec/gherkin/fixtures/complex.feature +45 -0
  124. data/spec/gherkin/fixtures/complex.json +139 -0
  125. data/spec/gherkin/fixtures/complex_for_filtering.feature +60 -0
  126. data/spec/gherkin/fixtures/complex_with_tags.feature +61 -0
  127. data/spec/gherkin/fixtures/dos_line_endings.feature +45 -0
  128. data/spec/gherkin/fixtures/examples_with_only_header.feature +14 -0
  129. data/spec/gherkin/fixtures/hantu_pisang.feature +35 -0
  130. data/spec/gherkin/fixtures/i18n_fr.feature +14 -0
  131. data/spec/gherkin/fixtures/i18n_fr2.feature +8 -0
  132. data/spec/gherkin/fixtures/i18n_no.feature +7 -0
  133. data/spec/gherkin/fixtures/i18n_pt1.feature +44 -0
  134. data/spec/gherkin/fixtures/i18n_pt2.feature +4 -0
  135. data/spec/gherkin/fixtures/i18n_pt3.feature +4 -0
  136. data/spec/gherkin/fixtures/i18n_pt4.feature +4 -0
  137. data/spec/gherkin/fixtures/i18n_zh-CN.feature +9 -0
  138. data/spec/gherkin/fixtures/issue_145.feature +22 -0
  139. data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +13 -0
  140. data/spec/gherkin/fixtures/scenario_without_steps.feature +5 -0
  141. data/spec/gherkin/fixtures/simple_with_comments.feature +7 -0
  142. data/spec/gherkin/fixtures/simple_with_tags.feature +11 -0
  143. data/spec/gherkin/fixtures/with_bom.feature +3 -0
  144. data/spec/gherkin/formatter/ansi_escapes_spec.rb +32 -0
  145. data/spec/gherkin/formatter/filter_formatter_spec.rb +204 -0
  146. data/spec/gherkin/formatter/json_formatter_spec.rb +92 -0
  147. data/spec/gherkin/formatter/model_spec.rb +28 -0
  148. data/spec/gherkin/formatter/pretty_formatter_spec.rb +177 -0
  149. data/spec/gherkin/formatter/spaces.feature +9 -0
  150. data/spec/gherkin/formatter/step_printer_spec.rb +55 -0
  151. data/spec/gherkin/formatter/tabs.feature +9 -0
  152. data/spec/gherkin/formatter/tag_count_formatter_spec.rb +30 -0
  153. data/spec/gherkin/i18n_spec.rb +241 -0
  154. data/spec/gherkin/java_lexer_spec.rb +20 -0
  155. data/spec/gherkin/js_lexer_spec.rb +23 -0
  156. data/spec/gherkin/json_parser_spec.rb +176 -0
  157. data/spec/gherkin/lexer/i18n_lexer_spec.rb +43 -0
  158. data/spec/gherkin/output_stream_string_io.rb +20 -0
  159. data/spec/gherkin/parser/parser_spec.rb +16 -0
  160. data/spec/gherkin/rb_lexer_spec.rb +20 -0
  161. data/spec/gherkin/sexp_recorder.rb +59 -0
  162. data/spec/gherkin/shared/bom_group.rb +20 -0
  163. data/spec/gherkin/shared/doc_string_group.rb +163 -0
  164. data/spec/gherkin/shared/lexer_group.rb +591 -0
  165. data/spec/gherkin/shared/row_group.rb +125 -0
  166. data/spec/gherkin/shared/tags_group.rb +54 -0
  167. data/spec/gherkin/tag_expression_spec.rb +142 -0
  168. data/spec/spec_helper.rb +75 -0
  169. data/tasks/bench.rake +184 -0
  170. data/tasks/bench/feature_builder.rb +49 -0
  171. data/tasks/bench/null_listener.rb +4 -0
  172. data/tasks/compile.rake +120 -0
  173. data/tasks/cucumber.rake +22 -0
  174. data/tasks/gems.rake +31 -0
  175. data/tasks/ikvm.rake +124 -0
  176. data/tasks/ragel_task.rb +100 -0
  177. data/tasks/release.rake +49 -0
  178. data/tasks/rspec.rake +8 -0
  179. data/tasks/yard.rake +7 -0
  180. data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
  181. data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
  182. data/tasks/yard/default/layout/html/footer.erb +5 -0
  183. data/tasks/yard/default/layout/html/index.erb +1 -0
  184. data/tasks/yard/default/layout/html/layout.erb +25 -0
  185. data/tasks/yard/default/layout/html/logo.erb +1 -0
  186. data/tasks/yard/default/layout/html/setup.rb +4 -0
  187. metadata +473 -0
@@ -0,0 +1,14 @@
1
+ Feature: An example with only a header
2
+ See [this thread](http://groups.google.com/group/cukes/browse_thread/thread/3e55777ee29c445c)
3
+
4
+ Scenario Outline:
5
+ When I do <foo>
6
+ Then something
7
+
8
+ Examples: A
9
+ | page |
10
+ | Golf |
11
+
12
+ @failing
13
+ Examples: B
14
+ | Scottish Football |
@@ -0,0 +1,35 @@
1
+ Feature: search examples
2
+
3
+ Background: The background
4
+ Given passing without a table
5
+
6
+ Scenario: should match Hantu Pisang
7
+ Given passing without a table
8
+
9
+ Scenario: Ignore me
10
+ Given failing without a table
11
+
12
+ Scenario Outline: Ignore me
13
+ Given <state> without a table
14
+
15
+ Examples:
16
+ | state |
17
+ | 1111111 |
18
+
19
+ Scenario Outline: Hantu Pisang match
20
+ Given <state> without a table
21
+
22
+ Examples:
23
+ | state |
24
+ | 2222222 |
25
+
26
+ Scenario Outline: no match in name but in examples
27
+ Given <state> without a table
28
+
29
+ Examples: Hantu Pisang
30
+ | state |
31
+ | 3333333 |
32
+
33
+ Examples: Ignore me
34
+ | state |
35
+ | 4444444 |
@@ -0,0 +1,14 @@
1
+ #language:fr
2
+ Fonctionnalité: Addition
3
+ Plan du scénario: Addition de produits dérivés
4
+ Soit une calculatrice
5
+ Etant donné qu'on tape <a>
6
+ Et qu'on tape <b>
7
+ Lorsqu'on tape additionner
8
+ Alors le résultat doit être <somme>
9
+
10
+ Exemples:
11
+ | a | b | somme |
12
+ | 2 | 2 | 4 |
13
+ | 2 | 3 | 5 |
14
+
@@ -0,0 +1,8 @@
1
+ #language:fr
2
+ Fonctionnalité: i18n
3
+
4
+ Scénario: Le French
5
+ Etant donné qqch
6
+ Etant donnée qqch
7
+ Etant donnés qqch
8
+ Etant données qqch
@@ -0,0 +1,7 @@
1
+ #language:no
2
+ Egenskap: i18n support
3
+
4
+ Scenario: Parsing many languages
5
+ Gitt Gherkin supports many languages
6
+ Når Norwegian keywords are parsed
7
+ Så they should be recognized
@@ -0,0 +1,44 @@
1
+ # language: pt
2
+ Funcionalidade: Reconhece "Funcionalidade"
3
+
4
+ Contexto: Reconhece "Contexto"
5
+
6
+ Cenário: Reconhece "Cenário" com acento
7
+
8
+ Cenario: Reconhece "Cenário" sem acento
9
+
10
+ Esquema do Cenário: Reconhece "Esquema do Cenário" com acento
11
+ Dado que <Valor> é um valor e que reconhece "Dado";
12
+ Dada a afirmação de que reconhece "Dada";
13
+ Dados os factos acima e ainda que reconhece "Dados";
14
+ Dadas as afirmações acima e ainda que reconhece "Dadas";
15
+ Quando reconhece "Quando";
16
+ Então também reconhece "Então" com acento e
17
+ Entao também reconhece "Então" sem acento;
18
+ E reconhece "E";
19
+ Mas também reconhece "Mas".
20
+
21
+ Exemplos: Reconhece "Exemplos"
22
+ | Valor |
23
+ | 1 |
24
+
25
+ Esquema do Cenario: Reconhece "Esquema do Cenário" sem acento
26
+ Dado que <Valor> é um valor;
27
+
28
+ Cenários: Reconhece "Cenários" com acento
29
+ | Valor |
30
+ | 1 |
31
+
32
+ Delineação do Cenário: Reconhece "Delineação do Cenário" com acento
33
+ Dado que <Valor> é um valor;
34
+
35
+ Cenarios: Reconhece "Cenários" sem acento
36
+ | Valor |
37
+ | 1 |
38
+
39
+ Delineacao do Cenario: Reconhece "Delineação do Cenário" sem acento
40
+ Dado que <Valor> é um valor;
41
+
42
+ Exemplos: Reconhece "Exemplos"
43
+ | Valor |
44
+ | 1 |
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Característica: Reconhece "Característica" com acento
3
+
4
+ Cenário de Fundo: Reconhece "Cenário de Fundo" com acento
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Caracteristica: Reconhece "Característica" sem acento
3
+
4
+ Cenario de Fundo: Reconhece "Cenário de Fundo" sem acento
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Característica: Reconhece "Característica" com acento
3
+
4
+ Fundo: Reconhece "Fundo"
@@ -0,0 +1,9 @@
1
+ #language:zh-CN
2
+ 功能:加法
3
+
4
+ 场景: 两个数相加
5
+ 假如我已经在计算器里输入6
6
+ 而且我已经在计算器里输入7
7
+ 当我按相加按钮
8
+ 那么我应该在屏幕上看到的结果是13
9
+
@@ -0,0 +1,22 @@
1
+ Feature: issue 145
2
+
3
+ Scenario: Scenario 1
4
+ Given some condition
5
+
6
+ Scenario Outline: Scenario 2
7
+ Given some condition
8
+ When I go to <page>
9
+ Then some assertion
10
+
11
+ Examples:
12
+ | page |
13
+ | /aaaa |
14
+ | /bbbb |
15
+ | /cccc |
16
+
17
+ Scenario: Scenario 3
18
+ Given some condition
19
+
20
+ Scenario: Scenario 4
21
+ Given some condition
22
+
@@ -0,0 +1,13 @@
1
+ Feature: Bug 67
2
+
3
+ @wip
4
+ Scenario Outline: WIP
5
+ When blah
6
+
7
+ Examples:
8
+ | a |
9
+ | b |
10
+ | c |
11
+
12
+ Scenario: Not WIP
13
+ When blah
@@ -0,0 +1,5 @@
1
+ Feature: f
2
+
3
+ Scenario: a
4
+
5
+ Scenario: b
@@ -0,0 +1,7 @@
1
+ # Here is a comment
2
+ Feature: Feature Text
3
+ # Here is another # comment
4
+ Scenario: Reading a Scenario
5
+ # Here is a third comment
6
+ Given there is a step
7
+ # Here is a fourth comment
@@ -0,0 +1,11 @@
1
+ # FC
2
+ @ft
3
+ Feature: hi
4
+
5
+ @st1 @st2
6
+ Scenario: First
7
+ Given Pepper
8
+
9
+ @st3
10
+ @st4 @ST5 @#^%&ST6**!
11
+ Scenario: Second
@@ -0,0 +1,3 @@
1
+ Feature: Feature Text
2
+ Scenario: Reading a Scenario
3
+ Given there is a step
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+ require 'gherkin/formatter/ansi_escapes'
3
+
4
+ module Gherkin
5
+ module Formatter
6
+ describe AnsiEscapes do
7
+ describe "instance methods" do
8
+ include AnsiEscapes
9
+
10
+ it "failed should be red" do
11
+ failed.should == "\e[31m"
12
+ end
13
+
14
+ it "failed_arg should be red bold" do
15
+ failed_arg.should == "\e[31m\e[1m"
16
+ end
17
+ end
18
+
19
+ describe "class methods" do
20
+ subject { AnsiEscapes }
21
+
22
+ it "failed should be red" do
23
+ subject.failed.should == "\e[31m"
24
+ end
25
+
26
+ it "failed_arg should be red bold" do
27
+ subject.failed_arg.should == "\e[31m\e[1m"
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,204 @@
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