aslakhellesoy-cucumber 0.1.4 → 0.1.5
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.
- metadata +14 -2
- data/History.txt +0 -4
- data/License.txt +0 -20
- data/Manifest.txt +0 -98
- data/README.txt +0 -42
- data/Rakefile +0 -4
- data/TODO.txt +0 -30
- data/bin/cucumber +0 -3
- data/config/hoe.rb +0 -69
- data/config/requirements.rb +0 -15
- data/examples/calculator/Rakefile +0 -6
- data/examples/calculator/features/addition.feature +0 -16
- data/examples/calculator/features/division.feature +0 -11
- data/examples/calculator/features/steps/calculator_steps.rb +0 -30
- data/examples/calculator/lib/calculator.rb +0 -16
- data/examples/calculator_ruby_features/Rakefile +0 -6
- data/examples/calculator_ruby_features/features/addition.rb +0 -23
- data/examples/calculator_ruby_features/features/steps/calculator_steps.rb +0 -43
- data/examples/java/README.textile +0 -22
- data/examples/java/Rakefile +0 -12
- data/examples/java/features/hello.feature +0 -11
- data/examples/java/features/steps/hello_steps.rb +0 -25
- data/examples/java/features/steps/tree_steps.rb +0 -14
- data/examples/java/features/tree.feature +0 -9
- data/examples/java/src/cucumber/demo/Hello.java +0 -15
- data/examples/norwegian_calculator/Rakefile +0 -6
- data/examples/norwegian_calculator/features/kalkulator_steps.rb +0 -31
- data/examples/norwegian_calculator/features/summering.feature +0 -13
- data/examples/watir/Rakefile +0 -6
- data/examples/watir/features/search.feature +0 -9
- data/examples/watir/features/steps/stories_steps.rb +0 -51
- data/gem_tasks/deployment.rake +0 -34
- data/gem_tasks/environment.rake +0 -7
- data/gem_tasks/fix_cr_lf.rake +0 -10
- data/gem_tasks/gemspec.rake +0 -6
- data/gem_tasks/rspec.rake +0 -21
- data/gem_tasks/treetop.rake +0 -27
- data/gem_tasks/website.rake +0 -17
- data/generators/cucumber/cucumber_generator.rb +0 -20
- data/generators/cucumber/templates/common_webrat.rb +0 -30
- data/generators/cucumber/templates/cucumber.rake +0 -7
- data/generators/cucumber/templates/env.rb +0 -6
- data/generators/feature/feature_generator.rb +0 -17
- data/generators/feature/templates/feature.erb +0 -27
- data/generators/feature/templates/steps.erb +0 -22
- data/lib/cucumber/cli.rb +0 -133
- data/lib/cucumber/core_ext/proc.rb +0 -43
- data/lib/cucumber/core_ext/string.rb +0 -17
- data/lib/cucumber/executor.rb +0 -79
- data/lib/cucumber/formatters/ansicolor.rb +0 -89
- data/lib/cucumber/formatters/html_formatter.rb +0 -272
- data/lib/cucumber/formatters/pretty_formatter.rb +0 -129
- data/lib/cucumber/formatters/progress_formatter.rb +0 -41
- data/lib/cucumber/formatters.rb +0 -1
- data/lib/cucumber/languages.yml +0 -31
- data/lib/cucumber/rails/rspec.rb +0 -12
- data/lib/cucumber/rails/world.rb +0 -71
- data/lib/cucumber/rake/task.rb +0 -75
- data/lib/cucumber/step_methods.rb +0 -41
- data/lib/cucumber/step_mother.rb +0 -38
- data/lib/cucumber/tree/feature.rb +0 -45
- data/lib/cucumber/tree/features.rb +0 -21
- data/lib/cucumber/tree/scenario.rb +0 -85
- data/lib/cucumber/tree/step.rb +0 -141
- data/lib/cucumber/tree/table.rb +0 -26
- data/lib/cucumber/tree/top_down_visitor.rb +0 -23
- data/lib/cucumber/tree.rb +0 -18
- data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -102
- data/lib/cucumber/treetop_parser/feature_en.rb +0 -974
- data/lib/cucumber/treetop_parser/feature_fr.rb +0 -974
- data/lib/cucumber/treetop_parser/feature_no.rb +0 -974
- data/lib/cucumber/treetop_parser/feature_parser.rb +0 -32
- data/lib/cucumber/treetop_parser/feature_pt.rb +0 -974
- data/lib/cucumber/version.rb +0 -9
- data/lib/cucumber.rb +0 -32
- data/script/console +0 -10
- data/script/console.cmd +0 -1
- data/script/destroy +0 -14
- data/script/destroy.cmd +0 -1
- data/script/generate +0 -14
- data/script/generate.cmd +0 -1
- data/script/txt2html +0 -74
- data/script/txt2html.cmd +0 -1
- data/setup.rb +0 -1585
- data/spec/cucumber/core_ext/string_spec.rb +0 -20
- data/spec/cucumber/executor_spec.rb +0 -55
- data/spec/cucumber/formatters/ansicolor_spec.rb +0 -18
- data/spec/cucumber/formatters/features.html +0 -274
- data/spec/cucumber/formatters/html_formatter_spec.rb +0 -59
- data/spec/cucumber/sell_cucumbers.feature +0 -9
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -40
- data/spec/cucumber/treetop_parser/spaces.feature +0 -10
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +0 -14
- data/website/index.html +0 -11
- data/website/index.txt +0 -39
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -138
- data/website/template.html.erb +0 -48
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.
|
4
|
+
version: 0.1.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: 2008-08-
|
12
|
+
date: 2008-08-28 00:00:00 -07:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -89,6 +89,9 @@ files:
|
|
89
89
|
- examples/calculator_ruby_features/Rakefile
|
90
90
|
- examples/calculator_ruby_features/features/addition.rb
|
91
91
|
- examples/calculator_ruby_features/features/steps/calculator_steps.rb
|
92
|
+
- examples/calculatrice_francaise_avec_soit_scenario/Rakefile
|
93
|
+
- examples/calculatrice_francaise_avec_soit_scenario/features/addition.feature
|
94
|
+
- examples/calculatrice_francaise_avec_soit_scenario/features/calculatrice_steps.rb
|
92
95
|
- examples/java/README.textile
|
93
96
|
- examples/java/Rakefile
|
94
97
|
- examples/java/features/hello.feature
|
@@ -105,12 +108,14 @@ files:
|
|
105
108
|
- gem_tasks/deployment.rake
|
106
109
|
- gem_tasks/environment.rake
|
107
110
|
- gem_tasks/fix_cr_lf.rake
|
111
|
+
- gem_tasks/flog.rake
|
108
112
|
- gem_tasks/gemspec.rake
|
109
113
|
- gem_tasks/rspec.rake
|
110
114
|
- gem_tasks/treetop.rake
|
111
115
|
- gem_tasks/website.rake
|
112
116
|
- generators/cucumber/cucumber_generator.rb
|
113
117
|
- generators/cucumber/templates/common_webrat.rb
|
118
|
+
- generators/cucumber/templates/cucumber
|
114
119
|
- generators/cucumber/templates/cucumber.rake
|
115
120
|
- generators/cucumber/templates/env.rb
|
116
121
|
- generators/feature/feature_generator.rb
|
@@ -123,7 +128,10 @@ files:
|
|
123
128
|
- lib/cucumber/executor.rb
|
124
129
|
- lib/cucumber/formatters.rb
|
125
130
|
- lib/cucumber/formatters/ansicolor.rb
|
131
|
+
- lib/cucumber/formatters/cucumber.css
|
132
|
+
- lib/cucumber/formatters/cucumber.js
|
126
133
|
- lib/cucumber/formatters/html_formatter.rb
|
134
|
+
- lib/cucumber/formatters/jquery.js
|
127
135
|
- lib/cucumber/formatters/pretty_formatter.rb
|
128
136
|
- lib/cucumber/formatters/progress_formatter.rb
|
129
137
|
- lib/cucumber/languages.yml
|
@@ -135,6 +143,7 @@ files:
|
|
135
143
|
- lib/cucumber/tree.rb
|
136
144
|
- lib/cucumber/tree/feature.rb
|
137
145
|
- lib/cucumber/tree/features.rb
|
146
|
+
- lib/cucumber/tree/given_scenario.rb
|
138
147
|
- lib/cucumber/tree/scenario.rb
|
139
148
|
- lib/cucumber/tree/step.rb
|
140
149
|
- lib/cucumber/tree/table.rb
|
@@ -161,7 +170,10 @@ files:
|
|
161
170
|
- spec/cucumber/formatters/features.html
|
162
171
|
- spec/cucumber/formatters/html_formatter_spec.rb
|
163
172
|
- spec/cucumber/sell_cucumbers.feature
|
173
|
+
- spec/cucumber/step_mother_spec.rb
|
174
|
+
- spec/cucumber/tree/scenario_spec.rb
|
164
175
|
- spec/cucumber/treetop_parser/feature_parser_spec.rb
|
176
|
+
- spec/cucumber/treetop_parser/given_scenario.feature
|
165
177
|
- spec/cucumber/treetop_parser/spaces.feature
|
166
178
|
- spec/spec.opts
|
167
179
|
- spec/spec_helper.rb
|
data/History.txt
DELETED
data/License.txt
DELETED
@@ -1,20 +0,0 @@
|
|
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
DELETED
@@ -1,98 +0,0 @@
|
|
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
|
-
examples/calculator/Rakefile
|
11
|
-
examples/calculator/features/addition.feature
|
12
|
-
examples/calculator/features/division.feature
|
13
|
-
examples/calculator/features/steps/calculator_steps.rb
|
14
|
-
examples/calculator/lib/calculator.rb
|
15
|
-
examples/calculator_ruby_features/Rakefile
|
16
|
-
examples/calculator_ruby_features/features/addition.rb
|
17
|
-
examples/calculator_ruby_features/features/steps/calculator_steps.rb
|
18
|
-
examples/java/README.textile
|
19
|
-
examples/java/Rakefile
|
20
|
-
examples/java/features/hello.feature
|
21
|
-
examples/java/features/steps/hello_steps.rb
|
22
|
-
examples/java/features/steps/tree_steps.rb
|
23
|
-
examples/java/features/tree.feature
|
24
|
-
examples/java/src/cucumber/demo/Hello.java
|
25
|
-
examples/norwegian_calculator/Rakefile
|
26
|
-
examples/norwegian_calculator/features/kalkulator_steps.rb
|
27
|
-
examples/norwegian_calculator/features/summering.feature
|
28
|
-
examples/watir/Rakefile
|
29
|
-
examples/watir/features/search.feature
|
30
|
-
examples/watir/features/steps/stories_steps.rb
|
31
|
-
gem_tasks/deployment.rake
|
32
|
-
gem_tasks/environment.rake
|
33
|
-
gem_tasks/fix_cr_lf.rake
|
34
|
-
gem_tasks/gemspec.rake
|
35
|
-
gem_tasks/rspec.rake
|
36
|
-
gem_tasks/treetop.rake
|
37
|
-
gem_tasks/website.rake
|
38
|
-
generators/cucumber/cucumber_generator.rb
|
39
|
-
generators/cucumber/templates/common_webrat.rb
|
40
|
-
generators/cucumber/templates/cucumber.rake
|
41
|
-
generators/cucumber/templates/env.rb
|
42
|
-
generators/feature/feature_generator.rb
|
43
|
-
generators/feature/templates/feature.erb
|
44
|
-
generators/feature/templates/steps.erb
|
45
|
-
lib/cucumber.rb
|
46
|
-
lib/cucumber/cli.rb
|
47
|
-
lib/cucumber/core_ext/proc.rb
|
48
|
-
lib/cucumber/core_ext/string.rb
|
49
|
-
lib/cucumber/executor.rb
|
50
|
-
lib/cucumber/formatters.rb
|
51
|
-
lib/cucumber/formatters/ansicolor.rb
|
52
|
-
lib/cucumber/formatters/html_formatter.rb
|
53
|
-
lib/cucumber/formatters/pretty_formatter.rb
|
54
|
-
lib/cucumber/formatters/progress_formatter.rb
|
55
|
-
lib/cucumber/languages.yml
|
56
|
-
lib/cucumber/rails/rspec.rb
|
57
|
-
lib/cucumber/rails/world.rb
|
58
|
-
lib/cucumber/rake/task.rb
|
59
|
-
lib/cucumber/step_methods.rb
|
60
|
-
lib/cucumber/step_mother.rb
|
61
|
-
lib/cucumber/tree.rb
|
62
|
-
lib/cucumber/tree/feature.rb
|
63
|
-
lib/cucumber/tree/features.rb
|
64
|
-
lib/cucumber/tree/scenario.rb
|
65
|
-
lib/cucumber/tree/step.rb
|
66
|
-
lib/cucumber/tree/table.rb
|
67
|
-
lib/cucumber/tree/top_down_visitor.rb
|
68
|
-
lib/cucumber/treetop_parser/feature.treetop.erb
|
69
|
-
lib/cucumber/treetop_parser/feature_en.rb
|
70
|
-
lib/cucumber/treetop_parser/feature_fr.rb
|
71
|
-
lib/cucumber/treetop_parser/feature_no.rb
|
72
|
-
lib/cucumber/treetop_parser/feature_parser.rb
|
73
|
-
lib/cucumber/treetop_parser/feature_pt.rb
|
74
|
-
lib/cucumber/version.rb
|
75
|
-
script/console
|
76
|
-
script/console.cmd
|
77
|
-
script/destroy
|
78
|
-
script/destroy.cmd
|
79
|
-
script/generate
|
80
|
-
script/generate.cmd
|
81
|
-
script/txt2html
|
82
|
-
script/txt2html.cmd
|
83
|
-
setup.rb
|
84
|
-
spec/cucumber/core_ext/string_spec.rb
|
85
|
-
spec/cucumber/executor_spec.rb
|
86
|
-
spec/cucumber/formatters/ansicolor_spec.rb
|
87
|
-
spec/cucumber/formatters/features.html
|
88
|
-
spec/cucumber/formatters/html_formatter_spec.rb
|
89
|
-
spec/cucumber/sell_cucumbers.feature
|
90
|
-
spec/cucumber/treetop_parser/feature_parser_spec.rb
|
91
|
-
spec/cucumber/treetop_parser/spaces.feature
|
92
|
-
spec/spec.opts
|
93
|
-
spec/spec_helper.rb
|
94
|
-
website/index.html
|
95
|
-
website/index.txt
|
96
|
-
website/javascripts/rounded_corners_lite.inc.js
|
97
|
-
website/stylesheets/screen.css
|
98
|
-
website/template.html.erb
|
data/README.txt
DELETED
@@ -1,42 +0,0 @@
|
|
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
DELETED
data/TODO.txt
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
== FEATURES/PROBLEMS:
|
2
|
-
|
3
|
-
* Run examples with:
|
4
|
-
** ruby -Ilib bin/cucumber examples/simple --require examples/simple/steps
|
5
|
-
** ruby -Ilib bin/cucumber examples/web --require examples/web/steps
|
6
|
-
|
7
|
-
* TODO: OK Refactor: Extract explicit node classes with RDoc (for better API doc)
|
8
|
-
* TODO: OK Get rid of the compile method. Compile the parser in Rake.
|
9
|
-
* TODO: OK Make grammar support \r\n, \r and \n (Add some fixture features for that)
|
10
|
-
* TODO: OK Make grammar support indentation
|
11
|
-
* TODO: OK Make grammar be totally relaxed about narrative
|
12
|
-
* TODO: OK Add a yaml file for different languages
|
13
|
-
* TODO: OK Custom nodes for the syntax tree
|
14
|
-
* TODO: OK Actually execute the features
|
15
|
-
* TODO: Make rake run specs by default
|
16
|
-
* TODO: OK Make it work with pure ruby regexen
|
17
|
-
* TODO: Make it work with string steps
|
18
|
-
* TODO: bin/cucumber --require [dir|file|glob]* --language no --format [file]*
|
19
|
-
* TODO: OK Pending steps shold print a block of code that can be pasted into code
|
20
|
-
* TODO: cucumber --where "Some text from a step" that prints "__FILE__:__LINE__ (STEP PATTERN)"
|
21
|
-
* TODO: Customisable trace output (like javascriptlint)
|
22
|
-
* TODO: Experiment: Make $variables become @variables
|
23
|
-
* TODO: GivenScenario
|
24
|
-
* TODO: OK PureRuby
|
25
|
-
* Make two trees include accept mixin
|
26
|
-
* TODO: Call steps from steps
|
27
|
-
* TODO: i18n in ruby too
|
28
|
-
* TODO: Don't load any treetop files if no .feature files are found
|
29
|
-
* TODO: Summary prints execution time
|
30
|
-
* TODO: --nocolor option
|
data/bin/cucumber
DELETED
data/config/hoe.rb
DELETED
@@ -1,69 +0,0 @@
|
|
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 = nil
|
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.4'], ['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'
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
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]))
|
@@ -1,16 +0,0 @@
|
|
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 130 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 |
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Feature: Division
|
2
|
-
In order to avoid silly mistakes
|
3
|
-
As a math idiot
|
4
|
-
I want to be told the division of two numbers
|
5
|
-
|
6
|
-
Scenario: Regular numbers
|
7
|
-
Given I have entered 3 into the calculator
|
8
|
-
And I have entered 2 into the calculator
|
9
|
-
When I press divide
|
10
|
-
Then the result should be 1.5 on the screen
|
11
|
-
And the result class should be Float
|
@@ -1,30 +0,0 @@
|
|
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 (\d+) 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
|
@@ -1,23 +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 Float"
|
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
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'spec'
|
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,22 +0,0 @@
|
|
1
|
-
h1. Using Cucumber with Java
|
2
|
-
|
3
|
-
This directory contains code to demonstrate how Cucumber can be used to develop Java code.
|
4
|
-
You need JRuby 1.1.3 or higher installed and JRuby's bin directory on your PATH.
|
5
|
-
|
6
|
-
h2. Installing required gems
|
7
|
-
|
8
|
-
jruby -S gem install aslakhellesoy-cucumber
|
9
|
-
jruby -S gem install diff-lcs
|
10
|
-
|
11
|
-
h2. Running the scenarios
|
12
|
-
|
13
|
-
Open a shell in this directory (java) and execute the following command:
|
14
|
-
|
15
|
-
<pre><code>
|
16
|
-
jruby -S rake features
|
17
|
-
</code></pre>
|
18
|
-
|
19
|
-
This will compile the java code and package it in a jar file, and then run Cucumber against
|
20
|
-
that code.
|
21
|
-
|
22
|
-
There is a deliberate error. See if you can fix it!
|
data/examples/java/Rakefile
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
2
|
-
require 'cucumber/rake/task'
|
3
|
-
|
4
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
5
|
-
t.cucumber_opts = "--format pretty"
|
6
|
-
end
|
7
|
-
|
8
|
-
task :features => :compile
|
9
|
-
|
10
|
-
task :compile do
|
11
|
-
sh "javac src/cucumber/demo/Hello.java && jar cf src/cucumber_demo.jar -C src cucumber/demo/Hello.class"
|
12
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Feature: Hello
|
2
|
-
In order to have more friends
|
3
|
-
I want to say hello
|
4
|
-
|
5
|
-
Scenario: Personal greeting
|
6
|
-
Given my name is Aslak
|
7
|
-
When I greet David
|
8
|
-
Then he should hear Hi, David. I'm Aslak.
|
9
|
-
And I should remember David as a friend
|
10
|
-
And I should get David's phone number
|
11
|
-
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'spec' # so we can call .should
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../src') # so the jar is found
|
3
|
-
require 'cucumber_demo' # puts the jar on the classpath
|
4
|
-
include_class 'cucumber.demo.Hello'
|
5
|
-
|
6
|
-
Given /my name is (\w+)/ do |name|
|
7
|
-
@hello = Hello.new # A java object
|
8
|
-
@name = name
|
9
|
-
end
|
10
|
-
|
11
|
-
When /I greet (.*)/ do |someone|
|
12
|
-
@greeting = @hello.greet(someone, @name)
|
13
|
-
end
|
14
|
-
|
15
|
-
Then /he should hear (.*)\./ do |message|
|
16
|
-
@greeting.should == message
|
17
|
-
end
|
18
|
-
|
19
|
-
Then /I should remember (\w+) as a friend/ do |name|
|
20
|
-
@hello.friend?(name).should == true
|
21
|
-
end
|
22
|
-
|
23
|
-
Then /I should get (\w+)'s phone number/ do |name|
|
24
|
-
@hello.getPhoneNumber(name).should_not == nil
|
25
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'spec'
|
2
|
-
include_class 'java.util.TreeSet'
|
3
|
-
|
4
|
-
Given /I have an empty set/ do
|
5
|
-
@set = TreeSet.new
|
6
|
-
end
|
7
|
-
|
8
|
-
When /I add (\w+)/ do |s|
|
9
|
-
@set.add(s)
|
10
|
-
end
|
11
|
-
|
12
|
-
Then /the contents should be (.*)/ do |s|
|
13
|
-
@set.to_a.join(" ").should == s
|
14
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
package cucumber.demo;
|
2
|
-
|
3
|
-
public class Hello {
|
4
|
-
public String greet(String who, String from) {
|
5
|
-
return "Hi, " + who + ". I'm " + from;
|
6
|
-
}
|
7
|
-
|
8
|
-
public boolean isFriend(String who) {
|
9
|
-
return true;
|
10
|
-
}
|
11
|
-
|
12
|
-
public String getPhoneNumber(String who) {
|
13
|
-
throw new RuntimeException("My phone is secret!");
|
14
|
-
}
|
15
|
-
}
|