cucumber 0.1.6
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/History.txt +3 -0
- data/License.txt +20 -0
- data/Manifest.txt +152 -0
- data/README.txt +42 -0
- data/Rakefile +4 -0
- data/TODO.txt +26 -0
- data/bin/cucumber +4 -0
- data/config/hoe.rb +69 -0
- data/config/requirements.rb +15 -0
- data/cucumber.yml +1 -0
- data/examples/calculator/Rakefile +6 -0
- data/examples/calculator/cucumber.yml +1 -0
- data/examples/calculator/features/addition.feature +16 -0
- data/examples/calculator/features/division.feature +10 -0
- data/examples/calculator/features/steps/calculator_steps.rb +31 -0
- data/examples/calculator/lib/calculator.rb +16 -0
- data/examples/calculator_ruby_features/Rakefile +6 -0
- data/examples/calculator_ruby_features/features/addition.rb +23 -0
- data/examples/calculator_ruby_features/features/steps/calculator_steps.rb +43 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/Rakefile +6 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/features/addition.feature +13 -0
- data/examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb +31 -0
- data/examples/cs/README.textile +22 -0
- data/examples/cs/Rakefile +12 -0
- data/examples/cs/features/hello.feature +11 -0
- data/examples/cs/features/steps/hello_steps.rb +25 -0
- data/examples/cs/features/steps/tree_steps.rb +14 -0
- data/examples/cs/features/tree.feature +9 -0
- data/examples/cs/src/Hello.cs +18 -0
- data/examples/danish_calculator/Rakefile +6 -0
- data/examples/danish_calculator/features/steps/kalkulator_steps.rb +22 -0
- data/examples/danish_calculator/features/summering.feature +17 -0
- data/examples/danish_calculator/lib/kalkulator.rb +11 -0
- data/examples/estonian_calculator/Rakefile +6 -0
- data/examples/estonian_calculator/features/kalkulaator_steps.rb +35 -0
- data/examples/estonian_calculator/features/liitmine.feature +16 -0
- data/examples/java/README.textile +22 -0
- data/examples/java/Rakefile +12 -0
- data/examples/java/features/hello.feature +11 -0
- data/examples/java/features/steps/hello_steps.rb +25 -0
- data/examples/java/features/steps/tree_steps.rb +14 -0
- data/examples/java/features/tree.feature +9 -0
- data/examples/java/src/cucumber/demo/Hello.java +16 -0
- data/examples/norwegian_calculator/Rakefile +6 -0
- data/examples/norwegian_calculator/features/steps/kalkulator_steps.rb +22 -0
- data/examples/norwegian_calculator/features/summering.feature +17 -0
- data/examples/norwegian_calculator/lib/kalkulator.rb +11 -0
- data/examples/portuguese_calculator/Rakefile +6 -0
- data/examples/portuguese_calculator/features/adicao.feature +10 -0
- data/examples/portuguese_calculator/features/calculadora_steps.rb +31 -0
- data/examples/selenium/Rakefile +6 -0
- data/examples/selenium/features/search.feature +9 -0
- data/examples/selenium/features/steps/stories_steps.rb +41 -0
- data/examples/spanish_calculator/Rakefile +6 -0
- data/examples/spanish_calculator/features/adicion.feature +17 -0
- data/examples/spanish_calculator/features/steps/calculador_steps.rb +22 -0
- data/examples/spanish_calculator/lib/Calculador.rb +11 -0
- data/examples/tickets/Rakefile +4 -0
- data/examples/tickets/features/steps/tickets_steps.rb +5 -0
- data/examples/tickets/features/tickets.feature +7 -0
- data/examples/watir/Rakefile +6 -0
- data/examples/watir/features/search.feature +9 -0
- data/examples/watir/features/steps/stories_steps.rb +51 -0
- data/features/see_features.feature +8 -0
- data/features/steps/features_steps.rb +9 -0
- data/gem_tasks/deployment.rake +34 -0
- data/gem_tasks/environment.rake +7 -0
- data/gem_tasks/features.rake +6 -0
- data/gem_tasks/fix_cr_lf.rake +10 -0
- data/gem_tasks/flog.rake +4 -0
- data/gem_tasks/gemspec.rake +6 -0
- data/gem_tasks/rspec.rake +21 -0
- data/gem_tasks/treetop.rake +27 -0
- data/generators/cucumber/cucumber_generator.rb +27 -0
- data/generators/cucumber/templates/common_webrat.rb +51 -0
- data/generators/cucumber/templates/cucumber +2 -0
- data/generators/cucumber/templates/cucumber.rake +7 -0
- data/generators/cucumber/templates/env.rb +8 -0
- data/generators/feature/feature_generator.rb +17 -0
- data/generators/feature/templates/feature.erb +27 -0
- data/generators/feature/templates/steps.erb +22 -0
- data/lib/cucumber.rb +32 -0
- data/lib/cucumber/cli.rb +163 -0
- data/lib/cucumber/core_ext/proc.rb +43 -0
- data/lib/cucumber/core_ext/string.rb +22 -0
- data/lib/cucumber/executor.rb +120 -0
- data/lib/cucumber/formatters.rb +1 -0
- data/lib/cucumber/formatters/ansicolor.rb +90 -0
- data/lib/cucumber/formatters/cucumber.css +132 -0
- data/lib/cucumber/formatters/cucumber.js +11 -0
- data/lib/cucumber/formatters/html_formatter.rb +125 -0
- data/lib/cucumber/formatters/jquery.js +32 -0
- data/lib/cucumber/formatters/pretty_formatter.rb +126 -0
- data/lib/cucumber/formatters/progress_formatter.rb +42 -0
- data/lib/cucumber/languages.yml +83 -0
- data/lib/cucumber/rails/rspec.rb +12 -0
- data/lib/cucumber/rails/world.rb +75 -0
- data/lib/cucumber/rake/task.rb +75 -0
- data/lib/cucumber/step_methods.rb +45 -0
- data/lib/cucumber/step_mother.rb +82 -0
- data/lib/cucumber/tree.rb +18 -0
- data/lib/cucumber/tree/feature.rb +53 -0
- data/lib/cucumber/tree/features.rb +21 -0
- data/lib/cucumber/tree/given_scenario.rb +13 -0
- data/lib/cucumber/tree/scenario.rb +110 -0
- data/lib/cucumber/tree/step.rb +123 -0
- data/lib/cucumber/tree/table.rb +26 -0
- data/lib/cucumber/tree/top_down_visitor.rb +23 -0
- data/lib/cucumber/treetop_parser/feature.treetop.erb +159 -0
- data/lib/cucumber/treetop_parser/feature_da.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_de.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_en.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_es.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_et.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_fr.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_no.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_parser.rb +32 -0
- data/lib/cucumber/treetop_parser/feature_pt.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_ru.rb +1214 -0
- data/lib/cucumber/treetop_parser/feature_se.rb +1214 -0
- data/lib/cucumber/version.rb +9 -0
- data/script/console +10 -0
- data/script/console.cmd +1 -0
- data/script/destroy +14 -0
- data/script/destroy.cmd +1 -0
- data/script/generate +14 -0
- data/script/generate.cmd +1 -0
- data/script/txt2html +74 -0
- data/script/txt2html.cmd +1 -0
- data/setup.rb +1585 -0
- data/spec/cucumber/cli_spec.rb +36 -0
- data/spec/cucumber/core_ext/proc_spec.rb +39 -0
- data/spec/cucumber/core_ext/string_spec.rb +34 -0
- data/spec/cucumber/executor_spec.rb +131 -0
- data/spec/cucumber/formatters/ansicolor_spec.rb +23 -0
- data/spec/cucumber/formatters/features.html +269 -0
- data/spec/cucumber/formatters/html_formatter_spec.rb +59 -0
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +17 -0
- data/spec/cucumber/formatters/progress_formatter_spec.rb +44 -0
- data/spec/cucumber/sell_cucumbers.feature +9 -0
- data/spec/cucumber/step_mother_spec.rb +53 -0
- data/spec/cucumber/tree/scenario_spec.rb +15 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +4 -0
- data/spec/cucumber/treetop_parser/empty_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +73 -0
- data/spec/cucumber/treetop_parser/fit_scenario.feature +7 -0
- data/spec/cucumber/treetop_parser/given_scenario.feature +9 -0
- data/spec/cucumber/treetop_parser/multiple_tables.feature +27 -0
- data/spec/cucumber/treetop_parser/spaces.feature +10 -0
- data/spec/cucumber/treetop_parser/with_comments.feature +6 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +23 -0
- metadata +259 -0
data/History.txt
ADDED
data/License.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2008 Aslak Hellesøy
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
History.txt
|
|
2
|
+
License.txt
|
|
3
|
+
Manifest.txt
|
|
4
|
+
README.txt
|
|
5
|
+
Rakefile
|
|
6
|
+
TODO.txt
|
|
7
|
+
bin/cucumber
|
|
8
|
+
config/hoe.rb
|
|
9
|
+
config/requirements.rb
|
|
10
|
+
cucumber.yml
|
|
11
|
+
examples/calculator/Rakefile
|
|
12
|
+
examples/calculator/cucumber.yml
|
|
13
|
+
examples/calculator/features/addition.feature
|
|
14
|
+
examples/calculator/features/division.feature
|
|
15
|
+
examples/calculator/features/steps/calculator_steps.rb
|
|
16
|
+
examples/calculator/lib/calculator.rb
|
|
17
|
+
examples/calculator_ruby_features/Rakefile
|
|
18
|
+
examples/calculator_ruby_features/features/addition.rb
|
|
19
|
+
examples/calculator_ruby_features/features/steps/calculator_steps.rb
|
|
20
|
+
examples/calculatrice_francaise_avec_soit_scenario/Rakefile
|
|
21
|
+
examples/calculatrice_francaise_avec_soit_scenario/features/addition.feature
|
|
22
|
+
examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb
|
|
23
|
+
examples/cs/README.textile
|
|
24
|
+
examples/cs/Rakefile
|
|
25
|
+
examples/cs/features/hello.feature
|
|
26
|
+
examples/cs/features/steps/hello_steps.rb
|
|
27
|
+
examples/cs/features/steps/tree_steps.rb
|
|
28
|
+
examples/cs/features/tree.feature
|
|
29
|
+
examples/cs/src/Hello.cs
|
|
30
|
+
examples/danish_calculator/Rakefile
|
|
31
|
+
examples/danish_calculator/features/steps/kalkulator_steps.rb
|
|
32
|
+
examples/danish_calculator/features/summering.feature
|
|
33
|
+
examples/danish_calculator/lib/kalkulator.rb
|
|
34
|
+
examples/estonian_calculator/Rakefile
|
|
35
|
+
examples/estonian_calculator/features/kalkulaator_steps.rb
|
|
36
|
+
examples/estonian_calculator/features/liitmine.feature
|
|
37
|
+
examples/java/README.textile
|
|
38
|
+
examples/java/Rakefile
|
|
39
|
+
examples/java/features/hello.feature
|
|
40
|
+
examples/java/features/steps/hello_steps.rb
|
|
41
|
+
examples/java/features/steps/tree_steps.rb
|
|
42
|
+
examples/java/features/tree.feature
|
|
43
|
+
examples/java/src/cucumber/demo/Hello.java
|
|
44
|
+
examples/norwegian_calculator/Rakefile
|
|
45
|
+
examples/norwegian_calculator/features/steps/kalkulator_steps.rb
|
|
46
|
+
examples/norwegian_calculator/features/summering.feature
|
|
47
|
+
examples/norwegian_calculator/lib/kalkulator.rb
|
|
48
|
+
examples/portuguese_calculator/Rakefile
|
|
49
|
+
examples/portuguese_calculator/features/adicao.feature
|
|
50
|
+
examples/portuguese_calculator/features/calculadora_steps.rb
|
|
51
|
+
examples/selenium/Rakefile
|
|
52
|
+
examples/selenium/features/search.feature
|
|
53
|
+
examples/selenium/features/steps/stories_steps.rb
|
|
54
|
+
examples/spanish_calculator/Rakefile
|
|
55
|
+
examples/spanish_calculator/features/adicion.feature
|
|
56
|
+
examples/spanish_calculator/features/steps/calculador_steps.rb
|
|
57
|
+
examples/spanish_calculator/lib/Calculador.rb
|
|
58
|
+
examples/tickets/Rakefile
|
|
59
|
+
examples/tickets/features/steps/tickets_steps.rb
|
|
60
|
+
examples/tickets/features/tickets.feature
|
|
61
|
+
examples/watir/Rakefile
|
|
62
|
+
examples/watir/features/search.feature
|
|
63
|
+
examples/watir/features/steps/stories_steps.rb
|
|
64
|
+
features/see_features.feature
|
|
65
|
+
features/steps/features_steps.rb
|
|
66
|
+
gem_tasks/deployment.rake
|
|
67
|
+
gem_tasks/environment.rake
|
|
68
|
+
gem_tasks/features.rake
|
|
69
|
+
gem_tasks/fix_cr_lf.rake
|
|
70
|
+
gem_tasks/flog.rake
|
|
71
|
+
gem_tasks/gemspec.rake
|
|
72
|
+
gem_tasks/rspec.rake
|
|
73
|
+
gem_tasks/treetop.rake
|
|
74
|
+
generators/cucumber/cucumber_generator.rb
|
|
75
|
+
generators/cucumber/templates/common_webrat.rb
|
|
76
|
+
generators/cucumber/templates/cucumber
|
|
77
|
+
generators/cucumber/templates/cucumber.rake
|
|
78
|
+
generators/cucumber/templates/env.rb
|
|
79
|
+
generators/feature/feature_generator.rb
|
|
80
|
+
generators/feature/templates/feature.erb
|
|
81
|
+
generators/feature/templates/steps.erb
|
|
82
|
+
lib/cucumber.rb
|
|
83
|
+
lib/cucumber/cli.rb
|
|
84
|
+
lib/cucumber/core_ext/proc.rb
|
|
85
|
+
lib/cucumber/core_ext/string.rb
|
|
86
|
+
lib/cucumber/executor.rb
|
|
87
|
+
lib/cucumber/formatters.rb
|
|
88
|
+
lib/cucumber/formatters/ansicolor.rb
|
|
89
|
+
lib/cucumber/formatters/cucumber.css
|
|
90
|
+
lib/cucumber/formatters/cucumber.js
|
|
91
|
+
lib/cucumber/formatters/html_formatter.rb
|
|
92
|
+
lib/cucumber/formatters/jquery.js
|
|
93
|
+
lib/cucumber/formatters/pretty_formatter.rb
|
|
94
|
+
lib/cucumber/formatters/progress_formatter.rb
|
|
95
|
+
lib/cucumber/languages.yml
|
|
96
|
+
lib/cucumber/rails/rspec.rb
|
|
97
|
+
lib/cucumber/rails/world.rb
|
|
98
|
+
lib/cucumber/rake/task.rb
|
|
99
|
+
lib/cucumber/step_methods.rb
|
|
100
|
+
lib/cucumber/step_mother.rb
|
|
101
|
+
lib/cucumber/tree.rb
|
|
102
|
+
lib/cucumber/tree/feature.rb
|
|
103
|
+
lib/cucumber/tree/features.rb
|
|
104
|
+
lib/cucumber/tree/given_scenario.rb
|
|
105
|
+
lib/cucumber/tree/scenario.rb
|
|
106
|
+
lib/cucumber/tree/step.rb
|
|
107
|
+
lib/cucumber/tree/table.rb
|
|
108
|
+
lib/cucumber/tree/top_down_visitor.rb
|
|
109
|
+
lib/cucumber/treetop_parser/feature.treetop.erb
|
|
110
|
+
lib/cucumber/treetop_parser/feature_da.rb
|
|
111
|
+
lib/cucumber/treetop_parser/feature_de.rb
|
|
112
|
+
lib/cucumber/treetop_parser/feature_en.rb
|
|
113
|
+
lib/cucumber/treetop_parser/feature_es.rb
|
|
114
|
+
lib/cucumber/treetop_parser/feature_et.rb
|
|
115
|
+
lib/cucumber/treetop_parser/feature_fr.rb
|
|
116
|
+
lib/cucumber/treetop_parser/feature_no.rb
|
|
117
|
+
lib/cucumber/treetop_parser/feature_parser.rb
|
|
118
|
+
lib/cucumber/treetop_parser/feature_pt.rb
|
|
119
|
+
lib/cucumber/treetop_parser/feature_ru.rb
|
|
120
|
+
lib/cucumber/treetop_parser/feature_se.rb
|
|
121
|
+
lib/cucumber/version.rb
|
|
122
|
+
script/console
|
|
123
|
+
script/console.cmd
|
|
124
|
+
script/destroy
|
|
125
|
+
script/destroy.cmd
|
|
126
|
+
script/generate
|
|
127
|
+
script/generate.cmd
|
|
128
|
+
script/txt2html
|
|
129
|
+
script/txt2html.cmd
|
|
130
|
+
setup.rb
|
|
131
|
+
spec/cucumber/cli_spec.rb
|
|
132
|
+
spec/cucumber/core_ext/proc_spec.rb
|
|
133
|
+
spec/cucumber/core_ext/string_spec.rb
|
|
134
|
+
spec/cucumber/executor_spec.rb
|
|
135
|
+
spec/cucumber/formatters/ansicolor_spec.rb
|
|
136
|
+
spec/cucumber/formatters/features.html
|
|
137
|
+
spec/cucumber/formatters/html_formatter_spec.rb
|
|
138
|
+
spec/cucumber/formatters/pretty_formatter_spec.rb
|
|
139
|
+
spec/cucumber/formatters/progress_formatter_spec.rb
|
|
140
|
+
spec/cucumber/sell_cucumbers.feature
|
|
141
|
+
spec/cucumber/step_mother_spec.rb
|
|
142
|
+
spec/cucumber/tree/scenario_spec.rb
|
|
143
|
+
spec/cucumber/treetop_parser/empty_feature.feature
|
|
144
|
+
spec/cucumber/treetop_parser/empty_scenario.feature
|
|
145
|
+
spec/cucumber/treetop_parser/feature_parser_spec.rb
|
|
146
|
+
spec/cucumber/treetop_parser/fit_scenario.feature
|
|
147
|
+
spec/cucumber/treetop_parser/given_scenario.feature
|
|
148
|
+
spec/cucumber/treetop_parser/multiple_tables.feature
|
|
149
|
+
spec/cucumber/treetop_parser/spaces.feature
|
|
150
|
+
spec/cucumber/treetop_parser/with_comments.feature
|
|
151
|
+
spec/spec.opts
|
|
152
|
+
spec/spec_helper.rb
|
data/README.txt
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
= Cucumber
|
|
2
|
+
|
|
3
|
+
* http://github.com/aslakhellesoy/cucumber
|
|
4
|
+
|
|
5
|
+
== DESCRIPTION:
|
|
6
|
+
|
|
7
|
+
Cucumber executes plain text documentation of code against that code.
|
|
8
|
+
Documentation: http://github.com/aslakhellesoy/cucumber/wikis/home
|
|
9
|
+
|
|
10
|
+
== REQUIREMENTS:
|
|
11
|
+
|
|
12
|
+
* FIX (list of requirements)
|
|
13
|
+
|
|
14
|
+
== INSTALL:
|
|
15
|
+
|
|
16
|
+
* gem sources --add http://gems.github.com/
|
|
17
|
+
* gem install aslakhellesoy-cucumber
|
|
18
|
+
|
|
19
|
+
== LICENSE:
|
|
20
|
+
|
|
21
|
+
(The MIT License)
|
|
22
|
+
|
|
23
|
+
Copyright (c) 2008 Aslak Hellesøy
|
|
24
|
+
|
|
25
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
26
|
+
a copy of this software and associated documentation files (the
|
|
27
|
+
'Software'), to deal in the Software without restriction, including
|
|
28
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
29
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
30
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
31
|
+
the following conditions:
|
|
32
|
+
|
|
33
|
+
The above copyright notice and this permission notice shall be
|
|
34
|
+
included in all copies or substantial portions of the Software.
|
|
35
|
+
|
|
36
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
37
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
38
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
39
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
40
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
41
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
42
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
data/TODO.txt
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
== FEATURES/PROBLEMS:
|
|
2
|
+
|
|
3
|
+
* TODO: OK Refactor: Extract explicit node classes with RDoc (for better API doc)
|
|
4
|
+
* TODO: OK Get rid of the compile method. Compile the parser in Rake.
|
|
5
|
+
* TODO: OK Make grammar support \r\n, \r and \n (Add some fixture features for that)
|
|
6
|
+
* TODO: OK Make grammar support indentation
|
|
7
|
+
* TODO: OK Make grammar be totally relaxed about narrative
|
|
8
|
+
* TODO: OK Add a yaml file for different languages
|
|
9
|
+
* TODO: OK Custom nodes for the syntax tree
|
|
10
|
+
* TODO: OK Actually execute the features
|
|
11
|
+
* TODO: Make rake run specs by default
|
|
12
|
+
* TODO: OK Make it work with pure ruby regexen
|
|
13
|
+
* TODO: OK Make it work with string steps
|
|
14
|
+
* TODO: bin/cucumber --require [dir|file|glob]* --language no --format [file]*
|
|
15
|
+
* TODO: OK Pending steps shold print a block of code that can be pasted into code
|
|
16
|
+
* TODO: cucumber --where "Some text from a step" that prints "__FILE__:__LINE__ (STEP PATTERN)"
|
|
17
|
+
* TODO: Customisable trace output (like javascriptlint)
|
|
18
|
+
* TODO: Experiment: Make $variables become @variables
|
|
19
|
+
* TODO: OK GivenScenario
|
|
20
|
+
* TODO: OK PureRuby
|
|
21
|
+
* Make two trees include accept mixin
|
|
22
|
+
* TODO: Call steps from steps
|
|
23
|
+
* TODO: i18n in ruby too
|
|
24
|
+
* TODO: Don't load any treetop files if no .feature files are found
|
|
25
|
+
* TODO: Summary prints execution time
|
|
26
|
+
* TODO: --nocolor option
|
data/bin/cucumber
ADDED
data/config/hoe.rb
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
require 'cucumber/version'
|
|
2
|
+
|
|
3
|
+
AUTHOR = 'Aslak Hellesøy' # can also be an array of Authors
|
|
4
|
+
EMAIL = "aslak.hellesoy@gmail.com"
|
|
5
|
+
DESCRIPTION = "Executable Feature scenarios"
|
|
6
|
+
GEM_NAME = 'cucumber' # what ppl will type to install your gem
|
|
7
|
+
HOMEPATH = "http://github.com/aslakhellesoy/cucumber"
|
|
8
|
+
RUBYFORGE_PROJECT = 'rspec'
|
|
9
|
+
|
|
10
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
|
11
|
+
@config = nil
|
|
12
|
+
RUBYFORGE_USERNAME = "aslak_hellesoy"
|
|
13
|
+
def rubyforge_username
|
|
14
|
+
unless @config
|
|
15
|
+
begin
|
|
16
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
|
17
|
+
rescue
|
|
18
|
+
puts <<-EOS
|
|
19
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
|
20
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
|
21
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
|
22
|
+
EOS
|
|
23
|
+
exit
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
REV = nil
|
|
31
|
+
# UNCOMMENT IF REQUIRED:
|
|
32
|
+
# REV = YAML.load(`svn info`)['Revision']
|
|
33
|
+
VERS = Cucumber::VERSION::STRING + (REV ? ".#{REV}" : "")
|
|
34
|
+
RDOC_OPTS = ['--quiet', '--title', 'Cucumber documentation',
|
|
35
|
+
"--opname", "index.html",
|
|
36
|
+
"--line-numbers",
|
|
37
|
+
"--main", "README.textile",
|
|
38
|
+
"--inline-source"]
|
|
39
|
+
|
|
40
|
+
class Hoe
|
|
41
|
+
def extra_deps
|
|
42
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
|
43
|
+
@extra_deps
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Generate all the Rake tasks
|
|
48
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
|
49
|
+
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
50
|
+
p.developer(AUTHOR, EMAIL)
|
|
51
|
+
p.description = DESCRIPTION
|
|
52
|
+
p.summary = DESCRIPTION
|
|
53
|
+
p.url = HOMEPATH
|
|
54
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
|
55
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store', '**/*.class', '**/*.jar'] #An array of file patterns to delete on clean.
|
|
56
|
+
|
|
57
|
+
# == Optional
|
|
58
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
|
59
|
+
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
|
60
|
+
p.extra_deps = [ ['term-ansicolor', '>= 1.0.3'], ['treetop', '>= 1.2.4'], ['rspec', '>= 1.1.5'], ['diff-lcs', '>= 1.1.2'] ]
|
|
61
|
+
|
|
62
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
|
63
|
+
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
|
67
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
|
68
|
+
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
|
69
|
+
$hoe.rsync_args = '-av --delete --ignore-errors'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
include FileUtils
|
|
3
|
+
|
|
4
|
+
require 'rubygems'
|
|
5
|
+
%w[rake hoe].each do |req_gem|
|
|
6
|
+
begin
|
|
7
|
+
require req_gem
|
|
8
|
+
rescue LoadError
|
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
|
11
|
+
exit
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
data/cucumber.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rest: --format progress features
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
default: --format progress features
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Feature: Addition
|
|
2
|
+
In order to avoid silly mistakes
|
|
3
|
+
As a math idiot
|
|
4
|
+
I want to be told the sum of two numbers
|
|
5
|
+
|
|
6
|
+
Scenario: Add two numbers
|
|
7
|
+
Given I have entered 50 into the calculator
|
|
8
|
+
And I have entered 70 into the calculator
|
|
9
|
+
When I press add
|
|
10
|
+
Then the result should be 120 on the screen
|
|
11
|
+
And the result class should be Fixnum
|
|
12
|
+
|
|
13
|
+
| input_1 | input_2 | button | output | class |
|
|
14
|
+
| 20 | 30 | add | 50 | Fixnum |
|
|
15
|
+
| 2 | 5 | add | 7 | Fixnum |
|
|
16
|
+
| 0 | 40 | add | 40 | Fixnum |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: Division
|
|
2
|
+
In order to avoid silly mistakes
|
|
3
|
+
Cashiers must be able to calculate a fraction
|
|
4
|
+
|
|
5
|
+
Scenario: Regular numbers
|
|
6
|
+
Given I have entered 3 into the calculator
|
|
7
|
+
And I have entered 2 into the calculator
|
|
8
|
+
When I press divide
|
|
9
|
+
Then the result should be 1.5 on the screen
|
|
10
|
+
And the result class should be Float
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'spec'
|
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
|
3
|
+
require 'calculator'
|
|
4
|
+
|
|
5
|
+
Before do
|
|
6
|
+
@calc = Calculator.new
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
After do
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
Given "I have entered $n into the calculator" do |n|
|
|
13
|
+
@calc.push n.to_i
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
When /I press (\w+)/ do |op|
|
|
17
|
+
@result = @calc.send op
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Then /the result should be (.*) on the screen/ do |result|
|
|
21
|
+
@result.should == result.to_f
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
Then /the result class should be (\w*)/ do |class_name|
|
|
25
|
+
@result.class.name.should == class_name
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
Given /it should rain on (\w+)/ do |day|
|
|
29
|
+
@calc.rain?(day).should == true
|
|
30
|
+
end
|
|
31
|
+
|