aslakhellesoy-cucumber 0.1.16.4 → 0.1.16.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/History.txt +75 -1
  2. data/Manifest.txt +58 -65
  3. data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
  4. data/examples/i18n/Rakefile +3 -3
  5. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -6
  6. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
  7. data/examples/i18n/de/features/addition.feature +6 -6
  8. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -2
  9. data/examples/i18n/en/features/addition.feature +6 -6
  10. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -2
  11. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
  12. data/examples/i18n/et/features/liitmine.feature +7 -6
  13. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
  14. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
  15. data/examples/i18n/fi/features/yhteenlasku.feature +2 -2
  16. data/examples/i18n/fr/features/addition.feature +2 -2
  17. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
  18. data/examples/i18n/id/features/addition.feature +6 -6
  19. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -2
  20. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
  21. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -3
  22. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
  23. data/examples/i18n/lt/features/addition.feature +7 -6
  24. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -2
  25. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +7 -7
  26. data/examples/i18n/no/features/summering.feature +1 -0
  27. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
  28. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
  29. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
  30. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -2
  31. data/examples/jbehave/README.textile +17 -0
  32. data/examples/jbehave/features/support/env.rb +7 -0
  33. data/examples/jbehave/features/trading.feature +24 -0
  34. data/examples/jbehave/pom.xml +48 -0
  35. data/examples/self_test/README.textile +4 -1
  36. data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
  37. data/examples/self_test/features/lots_of_undefined.feature +8 -0
  38. data/examples/self_test/features/outline_sample.feature +8 -5
  39. data/examples/self_test/features/sample.feature +5 -3
  40. data/examples/self_test/features/step_definitions/sample_steps.rb +15 -3
  41. data/features/cucumber_cli.feature +199 -97
  42. data/features/cucumber_cli_outlines.feature +46 -38
  43. data/features/report_called_undefined_steps.feature +31 -0
  44. data/features/step_definitions/cucumber_steps.rb +7 -3
  45. data/features/step_definitions/extra_steps.rb +1 -1
  46. data/features/support/env.rb +1 -1
  47. data/gem_tasks/features.rake +1 -1
  48. data/gem_tasks/flog.rake +1 -1
  49. data/lib/autotest/cucumber_mixin.rb +16 -23
  50. data/lib/cucumber/ast/comment.rb +26 -0
  51. data/lib/cucumber/ast/examples.rb +22 -0
  52. data/lib/cucumber/ast/feature.rb +60 -0
  53. data/lib/cucumber/ast/features.rb +39 -0
  54. data/lib/cucumber/ast/filter.rb +22 -0
  55. data/lib/cucumber/ast/outline_table.rb +49 -0
  56. data/lib/cucumber/ast/py_string.rb +52 -0
  57. data/lib/cucumber/ast/scenario.rb +91 -0
  58. data/lib/cucumber/ast/scenario_outline.rb +83 -0
  59. data/lib/cucumber/ast/step.rb +130 -0
  60. data/lib/cucumber/ast/table.rb +214 -0
  61. data/lib/cucumber/ast/tags.rb +33 -0
  62. data/lib/cucumber/ast/visitor.rb +93 -0
  63. data/lib/cucumber/ast.rb +27 -0
  64. data/lib/cucumber/broadcaster.rb +1 -6
  65. data/lib/cucumber/cli.rb +178 -128
  66. data/lib/cucumber/core_ext/exception.rb +41 -8
  67. data/lib/cucumber/core_ext/instance_exec.rb +54 -0
  68. data/lib/cucumber/core_ext/proc.rb +29 -65
  69. data/lib/cucumber/core_ext/string.rb +19 -0
  70. data/lib/cucumber/{formatters → formatter}/ansicolor.rb +11 -10
  71. data/lib/cucumber/formatter/console.rb +116 -0
  72. data/lib/cucumber/formatter/pretty.rb +158 -0
  73. data/lib/cucumber/formatter/profile.rb +77 -0
  74. data/lib/cucumber/formatter/progress.rb +68 -0
  75. data/lib/cucumber/formatter.rb +1 -0
  76. data/lib/cucumber/formatters/autotest_formatter.rb +0 -2
  77. data/lib/cucumber/formatters/html_formatter.rb +4 -3
  78. data/lib/cucumber/formatters/pretty_formatter.rb +1 -1
  79. data/lib/cucumber/formatters/unicode.rb +3 -3
  80. data/lib/cucumber/jbehave.rb +104 -0
  81. data/lib/cucumber/languages.yml +100 -73
  82. data/lib/cucumber/parser/basic.rb +0 -0
  83. data/lib/cucumber/parser/feature.rb +1694 -0
  84. data/lib/cucumber/parser/feature.tt +206 -0
  85. data/lib/cucumber/parser/file_parser.rb +50 -0
  86. data/lib/cucumber/parser/i18n.tt +26 -0
  87. data/lib/cucumber/parser/treetop_ext.rb +9 -0
  88. data/lib/cucumber/parser.rb +27 -0
  89. data/lib/cucumber/platform.rb +3 -17
  90. data/lib/cucumber/step_definition.rb +83 -0
  91. data/lib/cucumber/step_mother.rb +128 -72
  92. data/lib/cucumber/version.rb +1 -1
  93. data/lib/cucumber.rb +56 -9
  94. data/spec/cucumber/ast/feature_factory.rb +54 -0
  95. data/spec/cucumber/ast/feature_spec.rb +60 -0
  96. data/spec/cucumber/ast/py_string_spec.rb +40 -0
  97. data/spec/cucumber/ast/scenario_outline_spec.rb +64 -0
  98. data/spec/cucumber/ast/scenario_spec.rb +82 -0
  99. data/spec/cucumber/ast/step_spec.rb +45 -0
  100. data/spec/cucumber/ast/table_spec.rb +81 -0
  101. data/spec/cucumber/broadcaster_spec.rb +4 -17
  102. data/spec/cucumber/cli_spec.rb +43 -148
  103. data/spec/cucumber/core_ext/proc_spec.rb +27 -35
  104. data/spec/cucumber/core_ext/string_spec.rb +8 -0
  105. data/spec/cucumber/{formatters → formatter}/ansicolor_spec.rb +2 -2
  106. data/spec/cucumber/formatter/html/cucumber.css +37 -0
  107. data/spec/cucumber/formatter/html/cucumber.js +11 -0
  108. data/spec/cucumber/formatter/html/index.html +45 -0
  109. data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
  110. data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
  111. data/spec/cucumber/formatters/autotest_formatter_spec.rb +1 -0
  112. data/spec/cucumber/formatters/profile_formatter_spec.rb +17 -16
  113. data/spec/cucumber/parser/feature_parser_spec.rb +247 -0
  114. data/spec/cucumber/parser/table_parser_spec.rb +48 -0
  115. data/spec/cucumber/step_definition_spec.rb +62 -0
  116. data/spec/cucumber/step_mom_spec.rb +49 -0
  117. data/spec/cucumber/treetop_parser/empty_feature.feature +1 -1
  118. data/spec/cucumber/treetop_parser/spaces.feature +3 -1
  119. data/spec/cucumber/treetop_parser/with_comments.feature +1 -1
  120. data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
  121. data/spec/cucumber/world/pending_spec.rb +13 -12
  122. data/spec/spec_helper.rb +1 -1
  123. metadata +59 -67
  124. data/examples/calculator_ruby_features/Rakefile +0 -6
  125. data/examples/calculator_ruby_features/features/addition.rb +0 -39
  126. data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +0 -43
  127. data/gem_tasks/treetop.rake +0 -41
  128. data/lib/cucumber/executor.rb +0 -205
  129. data/lib/cucumber/formatters/profile_formatter.rb +0 -92
  130. data/lib/cucumber/formatters/progress_formatter.rb +0 -61
  131. data/lib/cucumber/formatters.rb +0 -1
  132. data/lib/cucumber/model/table.rb +0 -32
  133. data/lib/cucumber/model.rb +0 -1
  134. data/lib/cucumber/step_methods.rb +0 -49
  135. data/lib/cucumber/tree/feature.rb +0 -105
  136. data/lib/cucumber/tree/features.rb +0 -21
  137. data/lib/cucumber/tree/given_scenario.rb +0 -13
  138. data/lib/cucumber/tree/scenario.rb +0 -240
  139. data/lib/cucumber/tree/step.rb +0 -173
  140. data/lib/cucumber/tree/table.rb +0 -26
  141. data/lib/cucumber/tree/top_down_visitor.rb +0 -23
  142. data/lib/cucumber/tree.rb +0 -16
  143. data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -254
  144. data/lib/cucumber/treetop_parser/feature_ar.rb +0 -1951
  145. data/lib/cucumber/treetop_parser/feature_cy.rb +0 -1951
  146. data/lib/cucumber/treetop_parser/feature_da.rb +0 -1951
  147. data/lib/cucumber/treetop_parser/feature_de.rb +0 -1951
  148. data/lib/cucumber/treetop_parser/feature_en-lol.rb +0 -1951
  149. data/lib/cucumber/treetop_parser/feature_en-tx.rb +0 -1951
  150. data/lib/cucumber/treetop_parser/feature_en.rb +0 -1951
  151. data/lib/cucumber/treetop_parser/feature_es.rb +0 -1951
  152. data/lib/cucumber/treetop_parser/feature_et.rb +0 -1951
  153. data/lib/cucumber/treetop_parser/feature_fr.rb +0 -1951
  154. data/lib/cucumber/treetop_parser/feature_id.rb +0 -1951
  155. data/lib/cucumber/treetop_parser/feature_it.rb +0 -1951
  156. data/lib/cucumber/treetop_parser/feature_ja.rb +0 -1951
  157. data/lib/cucumber/treetop_parser/feature_ko.rb +0 -1951
  158. data/lib/cucumber/treetop_parser/feature_lt.rb +0 -1951
  159. data/lib/cucumber/treetop_parser/feature_nl.rb +0 -1951
  160. data/lib/cucumber/treetop_parser/feature_no.rb +0 -1951
  161. data/lib/cucumber/treetop_parser/feature_parser.rb +0 -36
  162. data/lib/cucumber/treetop_parser/feature_pl.rb +0 -1951
  163. data/lib/cucumber/treetop_parser/feature_pt.rb +0 -1951
  164. data/lib/cucumber/treetop_parser/feature_ro.rb +0 -1951
  165. data/lib/cucumber/treetop_parser/feature_ro2.rb +0 -1951
  166. data/lib/cucumber/treetop_parser/feature_ru.rb +0 -1951
  167. data/lib/cucumber/treetop_parser/feature_se.rb +0 -1951
  168. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +0 -1951
  169. data/lib/cucumber/world/pending.rb +0 -22
  170. data/lib/cucumber/world.rb +0 -1
  171. data/setup.rb +0 -1585
  172. data/spec/cucumber/executor_spec.rb +0 -382
  173. data/spec/cucumber/formatters/html_formatter_spec.rb +0 -104
  174. data/spec/cucumber/formatters/pretty_formatter_spec.rb +0 -410
  175. data/spec/cucumber/formatters/progress_formatter_spec.rb +0 -81
  176. data/spec/cucumber/model/table_spec.rb +0 -32
  177. data/spec/cucumber/step_mother_spec.rb +0 -74
  178. data/spec/cucumber/tree/feature_spec.rb +0 -122
  179. data/spec/cucumber/tree/row_scenario_outline_spec.rb +0 -73
  180. data/spec/cucumber/tree/row_scenario_spec.rb +0 -55
  181. data/spec/cucumber/tree/row_step_outline_spec.rb +0 -38
  182. data/spec/cucumber/tree/scenario_outline_spec.rb +0 -50
  183. data/spec/cucumber/tree/scenario_spec.rb +0 -134
  184. data/spec/cucumber/tree/step_outline_spec.rb +0 -17
  185. data/spec/cucumber/tree/step_spec.rb +0 -59
  186. data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -120
@@ -0,0 +1,48 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+ require 'treetop'
3
+ require 'cucumber/parser'
4
+
5
+ module Cucumber
6
+ module Parser
7
+ describe 'Tables' do
8
+ before do
9
+ @parser = FeatureParser.new
10
+ end
11
+
12
+ def parse(text)
13
+ @parser.__send__(:prepare_to_parse, text)
14
+ @parser.root = :table
15
+ table = @parser._nt_table
16
+ table.raw
17
+ end
18
+
19
+ it "should parse a 1x2 table with newline" do
20
+ parse(" | 1 | 2 | \n").should == [%w{1 2}]
21
+ end
22
+
23
+ it "should parse a 1x2 table without newline" do
24
+ parse("| 1 | 2 |").should == [%w{1 2}]
25
+ end
26
+
27
+ it "should parse a 1x2 table without spaces" do
28
+ parse("|1|2|").should == [%w{1 2}]
29
+ end
30
+
31
+ it "should parse a 2x2 table" do
32
+ parse("| 1 | 2 |\n| 3 | 4 |\n").should == [%w{1 2}, %w{3 4}]
33
+ end
34
+
35
+ it "should parse a 2x2 table with several newlines" do
36
+ parse("| 1 | 2 |\n| 3 | 4 |\n\n\n").should == [%w{1 2}, %w{3 4}]
37
+ end
38
+
39
+ it "should parse a 2x2 table with empty cells" do
40
+ parse("| 1 | |\n|| 4 |\n").should == [['1', nil], [nil, '4']]
41
+ end
42
+
43
+ it "should not parse a 2x2 table that isn't closed" do
44
+ parse("| 1 | |\n|| 4 ").should_not == [['1', nil], [nil, '4']]
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,62 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ require 'cucumber/ast'
4
+ require 'cucumber/step_mother'
5
+ require 'cucumber/step_definition'
6
+
7
+ module Cucumber
8
+ describe StepDefinition do
9
+ before do
10
+ extend StepMother
11
+ @world = new_world
12
+ $inside = nil
13
+ end
14
+
15
+ it "should allow calling of other steps" do
16
+ Given /Outside/ do
17
+ Given "Inside"
18
+ end
19
+ Given /Inside/ do
20
+ $inside = true
21
+ end
22
+
23
+ step_definition("Outside").execute(nil, @world)
24
+ $inside.should == true
25
+ end
26
+
27
+ it "should allow calling of other steps with inline arg" do
28
+ Given /Outside/ do
29
+ Given "Inside", Ast::Table.new([['inside']])
30
+ end
31
+ Given /Inside/ do |table|
32
+ $inside = table.raw[0][0]
33
+ end
34
+
35
+ step_definition("Outside").execute(nil, @world)
36
+ $inside.should == 'inside'
37
+ end
38
+
39
+ it "should raise Undefined when inside step is not defined" do
40
+ Given /Outside/ do
41
+ Given 'Inside'
42
+ end
43
+
44
+ step = mock('Step')
45
+ step.should_receive(:exception=)
46
+ lambda do
47
+ @world.__cucumber_current_step = step
48
+ step_definition('Outside').execute(nil, @world)
49
+ end.should raise_error(StepMother::Undefined, 'Undefined step: "Inside"')
50
+ end
51
+
52
+ it "should allow forced pending" do
53
+ Given /Outside/ do
54
+ pending("Do me!")
55
+ end
56
+
57
+ lambda do
58
+ step_definition("Outside").execute(nil, @world)
59
+ end.should raise_error(StepMother::Pending, "Do me!")
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,49 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ require 'cucumber/step_mother'
4
+
5
+ module Cucumber
6
+ describe StepMother do
7
+ before do
8
+ @step_mother = Object.new
9
+ @step_mother.extend(StepMother)
10
+ @visitor = mock('Visitor')
11
+ end
12
+
13
+ it "should format step names" do
14
+ @step_mother.Given(/it (.*) in (.*)/) do |what, month|
15
+ end
16
+ @step_mother.Given(/nope something else/) do |what, month|
17
+ end
18
+ format = @step_mother.step_definition("it snows in april").format_args("it snows in april", "[%s]")
19
+ format.should == "it [snows] in [april]"
20
+ end
21
+
22
+ it "should raise Ambiguous error when multiple step definitions match" do
23
+ @step_mother.Given(/Three (.*) mice/) {|disability|}
24
+ @step_mother.Given(/Three blind (.*)/) {|animal|}
25
+
26
+ lambda do
27
+ @step_mother.step_definition("Three blind mice")
28
+ end.should raise_error(StepMother::Ambiguous, %{Ambiguous match of "Three blind mice":
29
+
30
+ spec/cucumber/step_mom_spec.rb:23:in `/Three (.*) mice/'
31
+ spec/cucumber/step_mom_spec.rb:24:in `/Three blind (.*)/'
32
+
33
+ })
34
+ end
35
+
36
+ it "should raise Undefined error when no step definitions match" do
37
+ lambda do
38
+ @step_mother.step_definition("Three blind mice")
39
+ end.should raise_error(StepMother::Undefined)
40
+ end
41
+
42
+ it "should raise Redundant error when same regexp is registered twice" do
43
+ @step_mother.Given(/Three (.*) mice/) {|disability|}
44
+ lambda do
45
+ @step_mother.Given(/Three (.*) mice/) {|disability|}
46
+ end.should raise_error(StepMother::Redundant)
47
+ end
48
+ end
49
+ end
@@ -1,4 +1,4 @@
1
1
  Feature: No scenarios yet
2
- I order to ...
2
+ In order to ...
3
3
  As a ...
4
4
  I want to ...
@@ -1,4 +1,6 @@
1
- Some title
1
+
2
+
3
+ Feature: Some title
2
4
 
3
5
  Scenario: first
4
6
 
@@ -1,6 +1,6 @@
1
1
  # Header title
2
2
  # Two lines
3
- Some header
3
+ Feature: Some header
4
4
 
5
5
  # Scenario header
6
6
  # on two lines
@@ -0,0 +1,18 @@
1
+ # Uhm hai
2
+ # nai
3
+ @nice @hallo
4
+ Feature: With tags
5
+
6
+ @one @two
7
+ Scenario: Complete scenario
8
+ Given a valid API key
9
+
10
+ @three
11
+ Scenario: Will write at somepoint
12
+
13
+ @four @$$
14
+ Scenario: Another Complete scenario
15
+ Given an invalid API key
16
+
17
+ @six
18
+ Scenario Outline: Jalla
@@ -1,44 +1,45 @@
1
1
  require File.dirname(__FILE__) + '/../../spec_helper'
2
2
 
3
3
  module Cucumber
4
- module World
5
- describe Pending do
4
+ module StepMother
5
+ describe 'Pending' do
6
6
 
7
7
  before(:each) do
8
- @world = Object.new
9
- @world.extend(World::Pending)
8
+ @step_mom = Object.new
9
+ @step_mom.extend(StepMother)
10
+ @world = @step_mom.new_world
10
11
  end
11
12
 
12
- it 'should raise a ForcedPending if no block is supplied' do
13
+ it 'should raise a Pending if no block is supplied' do
13
14
  lambda {
14
15
  @world.pending "TODO"
15
- }.should raise_error(ForcedPending, /TODO/)
16
+ }.should raise_error(Pending, /TODO/)
16
17
  end
17
18
 
18
- it 'should raise a ForcedPending if a supplied block fails as expected' do
19
+ it 'should raise a Pending if a supplied block fails as expected' do
19
20
  lambda {
20
21
  @world.pending "TODO" do
21
22
  raise "oops"
22
23
  end
23
- }.should raise_error(ForcedPending, /TODO/)
24
+ }.should raise_error(Pending, /TODO/)
24
25
  end
25
26
 
26
- it 'should raise a ForcedPending if a supplied block fails as expected with a mock' do
27
+ it 'should raise a Pending if a supplied block fails as expected with a mock' do
27
28
  lambda {
28
29
  @world.pending "TODO" do
29
30
  m = mock('thing')
30
31
  m.should_receive(:foo)
31
32
  m.rspec_verify
32
33
  end
33
- }.should raise_error(ForcedPending, /TODO/)
34
+ }.should raise_error(Pending, /TODO/)
34
35
  end
35
36
 
36
- it 'should raise a ForcedPending if a supplied block starts working' do
37
+ it 'should raise a Pending if a supplied block starts working' do
37
38
  lambda {
38
39
  @world.pending "TODO" do
39
40
  # success!
40
41
  end
41
- }.should raise_error(ForcedPending, /TODO/)
42
+ }.should raise_error(Pending, /TODO/)
42
43
  end
43
44
 
44
45
  end
data/spec/spec_helper.rb CHANGED
@@ -6,8 +6,8 @@ ENV['CUCUMBER_COLORS']=nil
6
6
  $KCODE='u'
7
7
  $:.unshift(File.dirname(__FILE__) + '/../lib')
8
8
  require 'cucumber'
9
- require 'cucumber/treetop_parser/feature_en'
10
9
  Cucumber.load_language('en')
10
+ $:.unshift(File.dirname(__FILE__))
11
11
 
12
12
  ::Term::ANSIColor.coloring = true
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16.4
4
+ version: 0.1.16.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-23 00:00:00 -08:00
12
+ date: 2009-01-25 00:00:00 -08:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -71,9 +71,6 @@ files:
71
71
  - config/hoe.rb
72
72
  - config/requirements.rb
73
73
  - cucumber.yml
74
- - examples/calculator_ruby_features/Rakefile
75
- - examples/calculator_ruby_features/features/addition.rb
76
- - examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
77
74
  - examples/cs/README.textile
78
75
  - examples/cs/Rakefile
79
76
  - examples/cs/compile.bat
@@ -170,10 +167,17 @@ files:
170
167
  - examples/java/features/step_definitons/hello_steps.rb
171
168
  - examples/java/features/step_definitons/tree_steps.rb
172
169
  - examples/java/features/tree.feature
170
+ - examples/jbehave/README.textile
171
+ - examples/jbehave/features/support/env.rb
172
+ - examples/jbehave/features/trading.feature
173
+ - examples/jbehave/pom.xml
174
+ - examples/jbehave/target/maven-archiver/pom.properties
173
175
  - examples/selenium/Rakefile
174
176
  - examples/selenium/features/search.feature
175
177
  - examples/selenium/features/step_definitons/stories_steps.rb
176
178
  - examples/self_test/README.textile
179
+ - examples/self_test/features/call_undefined_step_from_step_def.feature
180
+ - examples/self_test/features/lots_of_undefined.feature
177
181
  - examples/self_test/features/outline_sample.feature
178
182
  - examples/self_test/features/sample.feature
179
183
  - examples/self_test/features/step_definitions/sample_steps.rb
@@ -195,6 +199,7 @@ files:
195
199
  - examples/watir/features/support/env.rb
196
200
  - features/cucumber_cli.feature
197
201
  - features/cucumber_cli_outlines.feature
202
+ - features/report_called_undefined_steps.feature
198
203
  - features/step_definitions/cucumber_steps.rb
199
204
  - features/step_definitions/extra_steps.rb
200
205
  - features/support/env.rb
@@ -205,7 +210,6 @@ files:
205
210
  - gem_tasks/flog.rake
206
211
  - gem_tasks/gemspec.rake
207
212
  - gem_tasks/rspec.rake
208
- - gem_tasks/treetop.rake
209
213
  - gem_tasks/yard.rake
210
214
  - lib/autotest/cucumber.rb
211
215
  - lib/autotest/cucumber_mixin.rb
@@ -214,70 +218,56 @@ files:
214
218
  - lib/autotest/cucumber_rspec.rb
215
219
  - lib/autotest/discover.rb
216
220
  - lib/cucumber.rb
221
+ - lib/cucumber/ast.rb
222
+ - lib/cucumber/ast/comment.rb
223
+ - lib/cucumber/ast/examples.rb
224
+ - lib/cucumber/ast/feature.rb
225
+ - lib/cucumber/ast/features.rb
226
+ - lib/cucumber/ast/filter.rb
227
+ - lib/cucumber/ast/outline_table.rb
228
+ - lib/cucumber/ast/py_string.rb
229
+ - lib/cucumber/ast/scenario.rb
230
+ - lib/cucumber/ast/scenario_outline.rb
231
+ - lib/cucumber/ast/step.rb
232
+ - lib/cucumber/ast/table.rb
233
+ - lib/cucumber/ast/tags.rb
234
+ - lib/cucumber/ast/visitor.rb
217
235
  - lib/cucumber/broadcaster.rb
218
236
  - lib/cucumber/cli.rb
219
237
  - lib/cucumber/core_ext/exception.rb
238
+ - lib/cucumber/core_ext/instance_exec.rb
220
239
  - lib/cucumber/core_ext/proc.rb
221
240
  - lib/cucumber/core_ext/string.rb
222
- - lib/cucumber/executor.rb
223
- - lib/cucumber/formatters.rb
224
- - lib/cucumber/formatters/ansicolor.rb
241
+ - lib/cucumber/formatter.rb
242
+ - lib/cucumber/formatter/ansicolor.rb
243
+ - lib/cucumber/formatter/console.rb
244
+ - lib/cucumber/formatter/pretty.rb
245
+ - lib/cucumber/formatter/profile.rb
246
+ - lib/cucumber/formatter/progress.rb
225
247
  - lib/cucumber/formatters/autotest_formatter.rb
226
248
  - lib/cucumber/formatters/cucumber.css
227
249
  - lib/cucumber/formatters/cucumber.js
228
250
  - lib/cucumber/formatters/html_formatter.rb
229
251
  - lib/cucumber/formatters/jquery.js
230
252
  - lib/cucumber/formatters/pretty_formatter.rb
231
- - lib/cucumber/formatters/profile_formatter.rb
232
- - lib/cucumber/formatters/progress_formatter.rb
233
253
  - lib/cucumber/formatters/unicode.rb
254
+ - lib/cucumber/jbehave.rb
234
255
  - lib/cucumber/languages.yml
235
- - lib/cucumber/model.rb
236
- - lib/cucumber/model/table.rb
256
+ - lib/cucumber/parser.rb
257
+ - lib/cucumber/parser/basic.rb
258
+ - lib/cucumber/parser/feature.rb
259
+ - lib/cucumber/parser/feature.tt
260
+ - lib/cucumber/parser/file_parser.rb
261
+ - lib/cucumber/parser/i18n.tt
262
+ - lib/cucumber/parser/treetop_ext.rb
237
263
  - lib/cucumber/platform.rb
238
264
  - lib/cucumber/rails/rspec.rb
239
265
  - lib/cucumber/rails/world.rb
240
266
  - lib/cucumber/rake/task.rb
241
- - lib/cucumber/step_methods.rb
267
+ - lib/cucumber/step_definition.rb
242
268
  - lib/cucumber/step_mother.rb
243
- - lib/cucumber/tree.rb
244
- - lib/cucumber/tree/feature.rb
245
- - lib/cucumber/tree/features.rb
246
- - lib/cucumber/tree/given_scenario.rb
247
- - lib/cucumber/tree/scenario.rb
248
- - lib/cucumber/tree/step.rb
249
- - lib/cucumber/tree/table.rb
250
- - lib/cucumber/tree/top_down_visitor.rb
251
- - lib/cucumber/treetop_parser/feature.treetop.erb
252
- - lib/cucumber/treetop_parser/feature_ar.rb
253
- - lib/cucumber/treetop_parser/feature_cy.rb
254
- - lib/cucumber/treetop_parser/feature_da.rb
255
- - lib/cucumber/treetop_parser/feature_de.rb
256
- - lib/cucumber/treetop_parser/feature_en-lol.rb
257
- - lib/cucumber/treetop_parser/feature_en-tx.rb
258
- - lib/cucumber/treetop_parser/feature_en.rb
259
- - lib/cucumber/treetop_parser/feature_es.rb
260
- - lib/cucumber/treetop_parser/feature_et.rb
261
269
  - lib/cucumber/treetop_parser/feature_fi.rb
262
- - lib/cucumber/treetop_parser/feature_fr.rb
263
- - lib/cucumber/treetop_parser/feature_id.rb
264
- - lib/cucumber/treetop_parser/feature_it.rb
265
- - lib/cucumber/treetop_parser/feature_ja.rb
266
- - lib/cucumber/treetop_parser/feature_ko.rb
267
- - lib/cucumber/treetop_parser/feature_lt.rb
268
- - lib/cucumber/treetop_parser/feature_nl.rb
269
- - lib/cucumber/treetop_parser/feature_no.rb
270
- - lib/cucumber/treetop_parser/feature_parser.rb
271
- - lib/cucumber/treetop_parser/feature_pl.rb
272
- - lib/cucumber/treetop_parser/feature_pt.rb
273
- - lib/cucumber/treetop_parser/feature_ro.rb
274
- - lib/cucumber/treetop_parser/feature_ro2.rb
275
- - lib/cucumber/treetop_parser/feature_ru.rb
276
- - lib/cucumber/treetop_parser/feature_se.rb
277
- - lib/cucumber/treetop_parser/feature_zh-CN.rb
278
270
  - lib/cucumber/version.rb
279
- - lib/cucumber/world.rb
280
- - lib/cucumber/world/pending.rb
281
271
  - rails_generators/cucumber/USAGE
282
272
  - rails_generators/cucumber/cucumber_generator.rb
283
273
  - rails_generators/cucumber/templates/cucumber
@@ -289,37 +279,38 @@ files:
289
279
  - rails_generators/feature/feature_generator.rb
290
280
  - rails_generators/feature/templates/feature.erb
291
281
  - rails_generators/feature/templates/steps.erb
292
- - setup.rb
282
+ - spec/cucumber/ast/feature_factory.rb
283
+ - spec/cucumber/ast/feature_spec.rb
284
+ - spec/cucumber/ast/py_string_spec.rb
285
+ - spec/cucumber/ast/scenario_outline_spec.rb
286
+ - spec/cucumber/ast/scenario_spec.rb
287
+ - spec/cucumber/ast/step_spec.rb
288
+ - spec/cucumber/ast/table_spec.rb
293
289
  - spec/cucumber/broadcaster_spec.rb
294
290
  - spec/cucumber/cli_spec.rb
295
291
  - spec/cucumber/core_ext/proc_spec.rb
296
292
  - spec/cucumber/core_ext/string_spec.rb
297
- - spec/cucumber/executor_spec.rb
298
- - spec/cucumber/formatters/ansicolor_spec.rb
293
+ - spec/cucumber/formatter/ansicolor_spec.rb
294
+ - spec/cucumber/formatter/html/cucumber.css
295
+ - spec/cucumber/formatter/html/cucumber.js
296
+ - spec/cucumber/formatter/html/index.html
297
+ - spec/cucumber/formatter/html/jquery-1.3.min.js
298
+ - spec/cucumber/formatter/html/jquery.uitableedit.js
299
+ - spec/cucumber/formatter/pretty_spec.rb
299
300
  - spec/cucumber/formatters/autotest_formatter_spec.rb
300
301
  - spec/cucumber/formatters/features.html
301
- - spec/cucumber/formatters/html_formatter_spec.rb
302
- - spec/cucumber/formatters/pretty_formatter_spec.rb
303
302
  - spec/cucumber/formatters/profile_formatter_spec.rb
304
- - spec/cucumber/formatters/progress_formatter_spec.rb
305
- - spec/cucumber/model/table_spec.rb
303
+ - spec/cucumber/parser/feature_parser_spec.rb
304
+ - spec/cucumber/parser/table_parser_spec.rb
306
305
  - spec/cucumber/rails/stubs/mini_rails.rb
307
306
  - spec/cucumber/rails/stubs/test_help.rb
308
307
  - spec/cucumber/rails/world_spec.rb
309
308
  - spec/cucumber/sell_cucumbers.feature
310
- - spec/cucumber/step_mother_spec.rb
311
- - spec/cucumber/tree/feature_spec.rb
312
- - spec/cucumber/tree/row_scenario_outline_spec.rb
313
- - spec/cucumber/tree/row_scenario_spec.rb
314
- - spec/cucumber/tree/row_step_outline_spec.rb
315
- - spec/cucumber/tree/scenario_outline_spec.rb
316
- - spec/cucumber/tree/scenario_spec.rb
317
- - spec/cucumber/tree/step_outline_spec.rb
318
- - spec/cucumber/tree/step_spec.rb
309
+ - spec/cucumber/step_definition_spec.rb
310
+ - spec/cucumber/step_mom_spec.rb
319
311
  - spec/cucumber/treetop_parser/empty_feature.feature
320
312
  - spec/cucumber/treetop_parser/empty_scenario.feature
321
313
  - spec/cucumber/treetop_parser/empty_scenario_outline.feature
322
- - spec/cucumber/treetop_parser/feature_parser_spec.rb
323
314
  - spec/cucumber/treetop_parser/fit_scenario.feature
324
315
  - spec/cucumber/treetop_parser/given_scenario.feature
325
316
  - spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
@@ -329,6 +320,7 @@ files:
329
320
  - spec/cucumber/treetop_parser/spaces.feature
330
321
  - spec/cucumber/treetop_parser/test_dos.feature
331
322
  - spec/cucumber/treetop_parser/with_comments.feature
323
+ - spec/cucumber/treetop_parser/with_tags.feature
332
324
  - spec/cucumber/world/pending_spec.rb
333
325
  - spec/spec.opts
334
326
  - spec/spec_helper.rb
@@ -1,6 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
- require 'cucumber/rake/task'
3
-
4
- Cucumber::Rake::Task.new do |t|
5
- t.cucumber_opts = "--format pretty"
6
- end
@@ -1,39 +0,0 @@
1
- require 'cucumber/cli' # Needed in order to run the feature with ruby
2
-
3
- Feature %|Addition
4
- In order to avoid silly mistakes
5
- As a math idiot
6
- I want to be told the sum of two numbers| do
7
-
8
- Scenario "Add two numbers" do
9
- Given "I have entered 50 into the calculator"
10
- And "I have entered 70 into the calculator"
11
- When "I add"
12
- Then "the result should be 120 on the screen"
13
- And "the result class should be Fixnum"
14
- end
15
-
16
- Table do |t|
17
- t | "input_1" | "input_2" | "output" | "class" | t
18
- # This is kind of dumb - but it illustrates how scenarios can be "generated" in code.
19
- 10.times do |n|
20
- t | n | n*2 | n*3 | Fixnum | t
21
- end
22
- end
23
-
24
- ScenarioOutline "Add two numbers" do
25
- Given "I have entered <input_1> into the calculator"
26
- And "I have entered <input_2> into the calculator"
27
- When "I add"
28
- Then "the result should be <output> on the screen"
29
- And "the result class should be <class>"
30
- end
31
-
32
- Table do |t|
33
- t | "input_1" | "input_2" | "output" | "class" | t
34
- 10.times do |n|
35
- t | n | n*2 | n*3 | Fixnum | t
36
- end
37
- end
38
-
39
- end
@@ -1,43 +0,0 @@
1
- require 'spec/expectations'
2
-
3
- class Calculator
4
- def push(n)
5
- @args ||= []
6
- @args << n
7
- end
8
-
9
- def add
10
- @args.inject(0){|n,sum| sum+=n}
11
- end
12
-
13
- def divide
14
- @args[0].to_f / @args[1].to_f
15
- end
16
- end
17
-
18
- Before do
19
- @calc = Calculator.new
20
- end
21
-
22
- After do
23
- end
24
-
25
- Given /I have entered (\d+) into the calculator/ do |n|
26
- @calc.push n.to_i
27
- end
28
-
29
- When 'I add' do
30
- @result = @calc.add
31
- end
32
-
33
- When 'I divide' do
34
- @result = @calc.divide
35
- end
36
-
37
- Then /the result should be (\d*) on the screen/ do |result|
38
- @result.should == result.to_i
39
- end
40
-
41
- Then /the result class should be (\w*)/ do |class_name|
42
- @result.class.name.should == class_name
43
- end
@@ -1,41 +0,0 @@
1
- class FeatureCompiler
2
- def initialize
3
- require 'yaml'
4
- require 'erb'
5
-
6
- @tt = RUBY_PLATFORM =~ /mswin|mingw/ ? 'tt.bat' : 'tt'
7
-
8
- @template = ERB.new(IO.read(File.dirname(__FILE__) + '/../lib/cucumber/treetop_parser/feature.treetop.erb'))
9
- @langs = YAML.load_file(File.dirname(__FILE__) + '/../lib/cucumber/languages.yml')
10
- end
11
-
12
- def compile_all
13
- @langs.keys.each do |lang|
14
- compile(lang)
15
- end
16
- end
17
-
18
- def compile(lang)
19
- words = @langs['en'].merge(@langs[lang]) # Use English words if languages.yml is missing a word
20
- grammar_file = File.dirname(__FILE__) + "/../lib/cucumber/treetop_parser/feature_#{lang}.treetop"
21
- ruby_file = File.dirname(__FILE__) + "/../lib/cucumber/treetop_parser/feature_#{lang}.rb"
22
- grammar = @template.result(binding)
23
- File.open(grammar_file, "wb") do |io|
24
- io.write(grammar)
25
- end
26
- sh "#{@tt} #{grammar_file}"
27
- FileUtils.rm(grammar_file)
28
- end
29
- end
30
-
31
- namespace :treetop do
32
- desc 'Compile the grammar for all languages in languages.yml'
33
- task :compile do
34
- FeatureCompiler.new.compile_all
35
- end
36
-
37
- desc 'Compile the English grammar'
38
- task :compile_en do
39
- FeatureCompiler.new.compile('en')
40
- end
41
- end