kosmas58-cucumber 0.3.96 → 0.3.97
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -3
- data/License.txt +2 -0
- data/Manifest.txt +9 -5
- data/config/hoe.rb +1 -0
- data/examples/i18n/Rakefile +5 -3
- data/examples/i18n/fi/features/yhteenlasku.feature +5 -4
- data/examples/python/features/step_definitions/fib_steps.py +3 -0
- data/examples/python/features/support/env.rb +21 -21
- data/gem_tasks/contributors.rake +8 -0
- data/gem_tasks/features.rake +1 -0
- data/gem_tasks/sdoc.rake +7 -0
- data/lib/README.rdoc +12 -0
- data/lib/cucumber/ast/background.rb +1 -1
- data/lib/cucumber/ast/comment.rb +1 -1
- data/lib/cucumber/ast/examples.rb +9 -4
- data/lib/cucumber/ast/feature.rb +1 -1
- data/lib/cucumber/ast/feature_element.rb +1 -1
- data/lib/cucumber/ast/features.rb +1 -1
- data/lib/cucumber/ast/outline_table.rb +2 -2
- data/lib/cucumber/ast/py_string.rb +1 -1
- data/lib/cucumber/ast/scenario.rb +1 -1
- data/lib/cucumber/ast/scenario_outline.rb +8 -7
- data/lib/cucumber/ast/step.rb +1 -1
- data/lib/cucumber/ast/step_collection.rb +1 -1
- data/lib/cucumber/ast/step_invocation.rb +1 -1
- data/lib/cucumber/ast/table.rb +65 -45
- data/lib/cucumber/ast/tags.rb +2 -2
- data/lib/cucumber/ast/visitor.rb +6 -8
- data/lib/cucumber/broadcaster.rb +1 -1
- data/lib/cucumber/cli/language_help_formatter.rb +1 -1
- data/lib/cucumber/cli/main.rb +15 -52
- data/lib/cucumber/constantize.rb +1 -1
- data/lib/cucumber/core_ext/exception.rb +1 -1
- data/lib/cucumber/core_ext/instance_exec.rb +8 -3
- data/lib/cucumber/core_ext/proc.rb +1 -1
- data/lib/cucumber/core_ext/string.rb +1 -1
- data/lib/cucumber/feature_file.rb +4 -3
- data/lib/cucumber/filter.rb +2 -1
- data/lib/cucumber/formatter/ansicolor.rb +6 -5
- data/lib/cucumber/formatter/color_io.rb +2 -2
- data/lib/cucumber/formatter/console.rb +2 -0
- data/lib/cucumber/formatter/duration.rb +3 -0
- data/lib/cucumber/formatter/html.rb +1 -0
- data/lib/cucumber/formatter/junit.rb +1 -0
- data/lib/cucumber/formatter/ordered_xml_markup.rb +1 -1
- data/lib/cucumber/formatter/pretty.rb +18 -4
- data/lib/cucumber/formatter/profile.rb +1 -0
- data/lib/cucumber/formatter/progress.rb +1 -0
- data/lib/cucumber/formatter/rerun.rb +2 -0
- data/lib/cucumber/formatter/steps.rb +1 -0
- data/lib/cucumber/formatter/tag_cloud.rb +2 -1
- data/lib/cucumber/formatter/unicode.rb +1 -1
- data/lib/cucumber/formatter/usage.rb +1 -0
- data/lib/cucumber/language_support/language_methods.rb +34 -12
- data/lib/cucumber/language_support.rb +30 -0
- data/lib/cucumber/parser/feature.rb +81 -57
- data/lib/cucumber/parser/feature.tt +3 -3
- data/lib/cucumber/parser/natural_language.rb +1 -1
- data/lib/cucumber/parser/table.rb +3 -0
- data/lib/cucumber/parser/treetop_ext.rb +6 -5
- data/lib/cucumber/platform.rb +1 -2
- data/lib/cucumber/py_support/py_dsl.py +8 -0
- data/lib/cucumber/py_support/py_language.py +2 -0
- data/lib/cucumber/py_support/py_language.rb +68 -0
- data/lib/cucumber/rails/world.rb +2 -1
- data/lib/cucumber/rake/task.rb +13 -11
- data/lib/cucumber/rb_support/rb_dsl.rb +27 -15
- data/lib/cucumber/rb_support/rb_hook.rb +1 -2
- data/lib/cucumber/rb_support/rb_language.rb +57 -33
- data/lib/cucumber/rb_support/rb_step_definition.rb +42 -38
- data/lib/cucumber/rb_support/rb_world.rb +93 -0
- data/lib/cucumber/rspec_neuter.rb +3 -3
- data/lib/cucumber/step_match.rb +2 -2
- data/lib/cucumber/step_mother.rb +91 -65
- data/lib/cucumber/version.rb +1 -1
- data/lib/cucumber/webrat/element_locator.rb +3 -3
- data/rails_generators/cucumber/templates/cucumber.rake +2 -0
- data/rails_generators/cucumber/templates/en/webrat_steps.rb +4 -0
- data/spec/cucumber/ast/background_spec.rb +8 -1
- data/spec/cucumber/ast/scenario_outline_spec.rb +1 -0
- data/spec/cucumber/ast/table_spec.rb +10 -0
- data/spec/cucumber/cli/options_spec.rb +1 -1
- data/spec/cucumber/parser/feature_parser_spec.rb +4 -0
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +114 -0
- data/spec/cucumber/step_mother_spec.rb +29 -10
- data/spec/cucumber/treetop_parser/with_comments.feature +14 -1
- data/spec/cucumber/world/pending_spec.rb +1 -1
- metadata +21 -7
- data/gem_tasks/yard.rake +0 -8
- data/lib/cucumber/language_support/hook_methods.rb +0 -9
- data/lib/cucumber/world.rb +0 -89
- data/spec/cucumber/ast/visitor_spec.rb +0 -27
- data/spec/cucumber/step_definition_spec.rb +0 -102
data/History.txt
CHANGED
@@ -1,6 +1,25 @@
|
|
1
|
+
== 0.3.97 2009-08-23
|
2
|
+
|
3
|
+
The AA-FTT release. Creating a release for the AA-FTT meeting in Chicago so that we can play
|
4
|
+
with the new language API and maybe knock out some better .NET support.
|
5
|
+
|
6
|
+
=== Bugfixes
|
7
|
+
* Allow comments on examples sections underneath scenario outlines (#420 Mike Sassak)
|
8
|
+
* Table.map_headers! will fail with a decent error message when 0 or 2+ headers are matched. (Aslak Hellesøy)
|
9
|
+
* Fixed an issue with comments with preceding spaces after a background causing a parse error (#401 Joseph Wilk)
|
10
|
+
|
11
|
+
=== New Features
|
12
|
+
* The public API is documented and there is a new :sdoc task to generate nice searchable API docs.
|
13
|
+
* Add :default => :cucumber when setting up Rake tasks for Cucumber in Rails (Aslak Hellesøy)
|
14
|
+
* New When /^I fill in "([^\"]*)" for "([^\"]*)"$/ Webrat step for Rails (Aslak Hellesøy)
|
15
|
+
|
16
|
+
=== Changed Features
|
17
|
+
* Changed the Programming Language API to support languages without "bleed through" (e.g. rubypython can't invoke ruby objs) (Aslak Hellesøy)
|
18
|
+
* The Programming Language API manages hooks on the language level instead of on the step mother level (Aslak Hellesøy)
|
19
|
+
|
1
20
|
== 0.3.96 2009-08-15
|
2
21
|
|
3
|
-
This release doesn't have any
|
22
|
+
This release doesn't have any significant new features or bug fixes, but there are big
|
4
23
|
internal changes. This release has a new API for plugging in other programming languages.
|
5
24
|
You can read more about that here: http://groups.google.com/group/cukes/browse_thread/thread/b9db8bf1f3ec9708
|
6
25
|
|
@@ -870,8 +889,8 @@ spaces removed too.
|
|
870
889
|
== 0.1.8 2008-10-18
|
871
890
|
|
872
891
|
This release extends the support for tables. PLEASE NOTE THAT TABLES ARE STILL EXPERIMENTAL.
|
873
|
-
In previous releases it has been possible to use tables to define "more examples" of a scenario
|
874
|
-
|
892
|
+
In previous releases it has been possible to use tables to define "more examples" of a scenario in
|
893
|
+
a FIT-style column fixture kind of way. Now you can also use tables as arguments to steps.
|
875
894
|
|
876
895
|
Tables used to define more examples after a scenario must now be prefixed. In English it looks like this:
|
877
896
|
|
data/License.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -168,6 +168,7 @@ examples/junit/features/pending.feature
|
|
168
168
|
examples/junit/features/step_definitions/steps.rb
|
169
169
|
examples/pure_java/README.textile
|
170
170
|
examples/python/features/fibonacci.feature
|
171
|
+
examples/python/features/step_definitions/fib_steps.py
|
171
172
|
examples/python/features/step_definitions/fib_steps.rb
|
172
173
|
examples/python/features/support/env.rb
|
173
174
|
examples/python/lib/fib.py
|
@@ -289,7 +290,8 @@ gem_tasks/flog.rake
|
|
289
290
|
gem_tasks/gemspec.rake
|
290
291
|
gem_tasks/rspec.rake
|
291
292
|
gem_tasks/sass.rake
|
292
|
-
gem_tasks/
|
293
|
+
gem_tasks/sdoc.rake
|
294
|
+
lib/README.rdoc
|
293
295
|
lib/autotest/cucumber.rb
|
294
296
|
lib/autotest/cucumber_mixin.rb
|
295
297
|
lib/autotest/cucumber_rails.rb
|
@@ -346,7 +348,7 @@ lib/cucumber/formatter/tag_cloud.rb
|
|
346
348
|
lib/cucumber/formatter/unicode.rb
|
347
349
|
lib/cucumber/formatter/usage.rb
|
348
350
|
lib/cucumber/formatters/unicode.rb
|
349
|
-
lib/cucumber/language_support
|
351
|
+
lib/cucumber/language_support.rb
|
350
352
|
lib/cucumber/language_support/language_methods.rb
|
351
353
|
lib/cucumber/language_support/step_definition_methods.rb
|
352
354
|
lib/cucumber/languages.yml
|
@@ -359,6 +361,9 @@ lib/cucumber/parser/table.rb
|
|
359
361
|
lib/cucumber/parser/table.tt
|
360
362
|
lib/cucumber/parser/treetop_ext.rb
|
361
363
|
lib/cucumber/platform.rb
|
364
|
+
lib/cucumber/py_support/py_dsl.py
|
365
|
+
lib/cucumber/py_support/py_language.py
|
366
|
+
lib/cucumber/py_support/py_language.rb
|
362
367
|
lib/cucumber/rails/rspec.rb
|
363
368
|
lib/cucumber/rails/world.rb
|
364
369
|
lib/cucumber/rake/task.rb
|
@@ -366,13 +371,13 @@ lib/cucumber/rb_support/rb_dsl.rb
|
|
366
371
|
lib/cucumber/rb_support/rb_hook.rb
|
367
372
|
lib/cucumber/rb_support/rb_language.rb
|
368
373
|
lib/cucumber/rb_support/rb_step_definition.rb
|
374
|
+
lib/cucumber/rb_support/rb_world.rb
|
369
375
|
lib/cucumber/rspec_neuter.rb
|
370
376
|
lib/cucumber/step_match.rb
|
371
377
|
lib/cucumber/step_mother.rb
|
372
378
|
lib/cucumber/version.rb
|
373
379
|
lib/cucumber/webrat/element_locator.rb
|
374
380
|
lib/cucumber/webrat/table_locator.rb
|
375
|
-
lib/cucumber/world.rb
|
376
381
|
rails_generators/cucumber/USAGE
|
377
382
|
rails_generators/cucumber/cucumber_generator.rb
|
378
383
|
rails_generators/cucumber/templates/cucumber
|
@@ -398,7 +403,6 @@ spec/cucumber/ast/scenario_spec.rb
|
|
398
403
|
spec/cucumber/ast/step_collection_spec.rb
|
399
404
|
spec/cucumber/ast/step_spec.rb
|
400
405
|
spec/cucumber/ast/table_spec.rb
|
401
|
-
spec/cucumber/ast/visitor_spec.rb
|
402
406
|
spec/cucumber/broadcaster_spec.rb
|
403
407
|
spec/cucumber/cli/configuration_spec.rb
|
404
408
|
spec/cucumber/cli/drb_client_spec.rb
|
@@ -417,8 +421,8 @@ spec/cucumber/parser/table_parser_spec.rb
|
|
417
421
|
spec/cucumber/rails/stubs/mini_rails.rb
|
418
422
|
spec/cucumber/rails/stubs/test_help.rb
|
419
423
|
spec/cucumber/rails/world_spec.rb
|
424
|
+
spec/cucumber/rb_support/rb_step_definition_spec.rb
|
420
425
|
spec/cucumber/sell_cucumbers.feature
|
421
|
-
spec/cucumber/step_definition_spec.rb
|
422
426
|
spec/cucumber/step_mother_spec.rb
|
423
427
|
spec/cucumber/treetop_parser/empty_feature.feature
|
424
428
|
spec/cucumber/treetop_parser/empty_scenario.feature
|
data/config/hoe.rb
CHANGED
@@ -63,6 +63,7 @@ $hoe = Hoe.spec(GEM_NAME) do |p|
|
|
63
63
|
p.extra_deps = [
|
64
64
|
['term-ansicolor', '>= 1.0.3'],
|
65
65
|
['treetop', '>= 1.3.0'],
|
66
|
+
['polyglot', '>= 0.2.8'], # Don't really want polyglot, but it keeps breaking so we'll make people use something that works ok'ish
|
66
67
|
['diff-lcs', '>= 1.1.2'],
|
67
68
|
['builder', '>= 2.1.2']
|
68
69
|
]
|
data/examples/i18n/Rakefile
CHANGED
@@ -6,7 +6,7 @@ task :i18n do
|
|
6
6
|
lang = f[dir.length+1..-1]
|
7
7
|
if examples_working?(lang)
|
8
8
|
Dir.chdir(f) do
|
9
|
-
rake("
|
9
|
+
rake("cucumber")
|
10
10
|
end
|
11
11
|
else
|
12
12
|
STDERR.puts %{
|
@@ -21,10 +21,12 @@ task :i18n do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
task :default => :i18n
|
25
|
+
|
24
26
|
def examples_working?(lang)
|
25
|
-
!%w{ro
|
27
|
+
!%w{ro}.index(lang)
|
26
28
|
end
|
27
29
|
|
28
30
|
def rake(args)
|
29
|
-
ruby($0, args)
|
31
|
+
ruby($0, args)
|
30
32
|
end
|
@@ -1,13 +1,14 @@
|
|
1
|
+
# language: fi
|
1
2
|
Ominaisuus: Yhteenlasku
|
2
3
|
Välttyäkseni hölmöiltä virheiltä
|
3
4
|
Koska olen laskutaidoton
|
4
5
|
Haluan että yhteenlaskut lasketaan puolestani
|
5
6
|
|
6
7
|
Tapausaihio: Kahden luvun summa
|
7
|
-
Oletetaan että olen syöttänyt laskimeen luvun
|
8
|
-
Ja että olen syöttänyt laskimeen luvun
|
9
|
-
Kun painan "
|
10
|
-
Niin laskimen ruudulla pitäisi näkyä tulos
|
8
|
+
Oletetaan että olen syöttänyt laskimeen luvun <luku_1>
|
9
|
+
Ja että olen syöttänyt laskimeen luvun <luku_2>
|
10
|
+
Kun painan "<nappi>"
|
11
|
+
Niin laskimen ruudulla pitäisi näkyä tulos <tulos>
|
11
12
|
|
12
13
|
Tapaukset:
|
13
14
|
| luku_1 | luku_2 | nappi | tulos |
|
@@ -1,21 +1,21 @@
|
|
1
|
-
require 'rubypython'
|
2
|
-
|
3
|
-
ENV['PYTHONPATH'] = File.expand_path(File.dirname(__FILE__) + '/../../lib')
|
4
|
-
|
5
|
-
Before do
|
6
|
-
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
After do
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
# RubyPython seems to expect this to exist (?)
|
15
|
-
class String
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
1
|
+
# require 'rubypython'
|
2
|
+
#
|
3
|
+
# ENV['PYTHONPATH'] = File.expand_path(File.dirname(__FILE__) + '/../../lib')
|
4
|
+
#
|
5
|
+
# Before do
|
6
|
+
# RubyPython.start
|
7
|
+
# @fib = RubyPython.import('fib')
|
8
|
+
# end
|
9
|
+
#
|
10
|
+
# After do
|
11
|
+
# RubyPython.stop
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# # RubyPython seems to expect this to exist (?)
|
15
|
+
# class String
|
16
|
+
# def end_with?(str)
|
17
|
+
# str = str.to_str
|
18
|
+
# tail = self[-str.length, str.length]
|
19
|
+
# tail == str
|
20
|
+
# end
|
21
|
+
# end
|
data/gem_tasks/contributors.rake
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
task :contributors do
|
2
2
|
contributors = `git log --pretty=short --no-merges | git shortlog -ne | egrep -ve '^ +' | egrep -ve '^$'`
|
3
3
|
puts contributors.split("\n").length
|
4
|
+
end
|
5
|
+
|
6
|
+
task :codeswarm do
|
7
|
+
sh "code_swarm --reload" rescue nil # Fails because of encoding - which we'll fix
|
8
|
+
sh "iconv -f latin1 -t utf-8 .git/.code_swarm/log.xml > tmp.xml && mv tmp.xml .git/.code_swarm/log.xml"
|
9
|
+
sh "sed -e 's/Aslak\ Hellesøy@.BEKK.no/aslak.hellesoy@gmail.com/g' .git/.code_swarm/log.xml > tmp.xml && mv tmp.xml .git/.code_swarm/log.xml"
|
10
|
+
sh "sed -e 's/josephwilk@joesniff.co.uk/joe@josephwilk.net/g' .git/.code_swarm/log.xml > tmp.xml && mv tmp.xml .git/.code_swarm/log.xml"
|
11
|
+
sh "code_swarm"
|
4
12
|
end
|
data/gem_tasks/features.rake
CHANGED
data/gem_tasks/sdoc.rake
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
require 'sdoc' # and use your RDoc task the same way you used it before
|
2
|
+
|
3
|
+
Rake::RDocTask.new(:sdoc) do |rdoc|
|
4
|
+
rdoc.rdoc_dir = 'doc/sdoc'
|
5
|
+
rdoc.options += %w{--fmt shtml -N --webcvs=http://github.com/aslakhellesoy/cucumber/blob/v0.3.96/%s --title "Cucumber API" --threads 4 --main README --exclude cucumber/parser lib}
|
6
|
+
rdoc.template = 'direct' # lighter template used on railsapi.com
|
7
|
+
end
|
data/lib/README.rdoc
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
= Cucumber API
|
2
|
+
|
3
|
+
This is the public API of Cucumber. The public API includes the classes, modules
|
4
|
+
and methods you can use if you are a user of Cucumber. It also applies to you if
|
5
|
+
you're developing a 3rd party tool that integrates with Cucumber.
|
6
|
+
|
7
|
+
== Internal API
|
8
|
+
|
9
|
+
Cucumber has more classes, modules and methods than what you can see in the public
|
10
|
+
API. If you decide to dive into the source code and make use of an API that isn't
|
11
|
+
part of this documentation - beware that this API might change at any time. If you
|
12
|
+
want a particular internal API to be promoted to the public API - let us know.
|
data/lib/cucumber/ast/comment.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module Cucumber
|
2
2
|
module Ast
|
3
|
-
class Examples
|
4
|
-
def initialize(line, keyword, name, outline_table)
|
5
|
-
@keyword, @name, @outline_table = keyword, name, outline_table
|
3
|
+
class Examples #:nodoc:
|
4
|
+
def initialize(comment, line, keyword, name, outline_table)
|
5
|
+
@comment, @keyword, @name, @outline_table = comment, keyword, name, outline_table
|
6
6
|
end
|
7
7
|
|
8
8
|
def accept(visitor)
|
9
9
|
return if $cucumber_interrupted
|
10
|
+
visitor.visit_comment(@comment) unless @comment.empty?
|
10
11
|
visitor.visit_examples_name(@keyword, @name)
|
11
12
|
visitor.visit_outline_table(@outline_table)
|
12
13
|
end
|
@@ -20,7 +21,11 @@ module Cucumber
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def to_sexp
|
23
|
-
[:examples, @keyword, @name
|
24
|
+
sexp = [:examples, @keyword, @name]
|
25
|
+
comment = @comment.to_sexp
|
26
|
+
sexp += [comment] if comment
|
27
|
+
sexp += [@outline_table.to_sexp]
|
28
|
+
sexp
|
24
29
|
end
|
25
30
|
end
|
26
31
|
end
|
data/lib/cucumber/ast/feature.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Cucumber
|
2
2
|
module Ast
|
3
|
-
class OutlineTable < Table
|
3
|
+
class OutlineTable < Table #:nodoc:
|
4
4
|
def initialize(raw, scenario_outline)
|
5
5
|
super(raw)
|
6
6
|
@scenario_outline = scenario_outline
|
@@ -44,7 +44,7 @@ module Cucumber
|
|
44
44
|
@scenario_outline.visit_scenario_name(visitor, row)
|
45
45
|
end
|
46
46
|
|
47
|
-
class ExampleRow < Cells
|
47
|
+
class ExampleRow < Cells #:nodoc:
|
48
48
|
attr_reader :scenario_outline # https://rspec.lighthouseapp.com/projects/16211/tickets/342
|
49
49
|
|
50
50
|
def create_step_invocations!(scenario_outline)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Cucumber
|
2
2
|
module Ast
|
3
|
-
class ScenarioOutline
|
3
|
+
class ScenarioOutline #:nodoc:
|
4
4
|
include FeatureElement
|
5
5
|
|
6
|
-
module ExamplesArray
|
6
|
+
module ExamplesArray #:nodoc:
|
7
7
|
def accept(visitor)
|
8
8
|
return if $cucumber_interrupted
|
9
9
|
each do |examples|
|
@@ -24,13 +24,14 @@ module Cucumber
|
|
24
24
|
@steps = StepCollection.new(steps)
|
25
25
|
|
26
26
|
@examples_array = example_sections.map do |example_section|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
examples_comment = example_section[0]
|
28
|
+
examples_line = example_section[1]
|
29
|
+
examples_keyword = example_section[2]
|
30
|
+
examples_name = example_section[3]
|
31
|
+
examples_matrix = example_section[4]
|
31
32
|
|
32
33
|
examples_table = OutlineTable.new(examples_matrix, self)
|
33
|
-
Examples.new(examples_line, examples_keyword, examples_name, examples_table)
|
34
|
+
Examples.new(examples_comment, examples_line, examples_keyword, examples_name, examples_table)
|
34
35
|
end
|
35
36
|
@examples_array.extend(ExamplesArray)
|
36
37
|
|
data/lib/cucumber/ast/step.rb
CHANGED