cucumber 0.3.104 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/History.txt +50 -3
  2. data/Manifest.txt +20 -2
  3. data/Rakefile +4 -0
  4. data/config/hoe.rb +20 -14
  5. data/examples/i18n/tr/Rakefile +6 -0
  6. data/examples/i18n/tr/features/bo/314/210lme.feature +10 -0
  7. data/examples/i18n/tr/features/step_definitons/hesap_makinesi_ad/304/261mlar/304/261.rb +24 -0
  8. data/examples/i18n/tr/features/toplama.feature +18 -0
  9. data/examples/i18n/tr/lib/hesap_makinesi.rb +15 -0
  10. data/examples/python/features/step_definitions/fib_steps.py +9 -1
  11. data/examples/ruby2python/features/fibonacci.feature +19 -0
  12. data/examples/{python → ruby2python}/features/step_definitions/fib_steps.rb +0 -0
  13. data/examples/ruby2python/features/support/env.rb +21 -0
  14. data/examples/ruby2python/lib/fib.py +7 -0
  15. data/features/bug_475.feature +43 -0
  16. data/features/exception_in_before_block.feature +34 -1
  17. data/features/html_formatter.feature +1 -1
  18. data/features/language_help.feature +68 -0
  19. data/features/rake_task.feature +34 -60
  20. data/features/simplest.feature +11 -0
  21. data/features/step_definitions/simplest_steps.rb +6 -0
  22. data/features/support/env.rb +1 -1
  23. data/features/support/env.rb.simplest +7 -0
  24. data/features/table_diffing.feature +1 -1
  25. data/features/table_mapping.feature +35 -0
  26. data/features/transform.feature +133 -2
  27. data/features/usage_and_stepdefs_formatter.feature +4 -2
  28. data/gem_tasks/contributors.rake +2 -1
  29. data/lib/cucumber/ast/background.rb +17 -5
  30. data/lib/cucumber/ast/outline_table.rb +8 -1
  31. data/lib/cucumber/ast/scenario.rb +2 -1
  32. data/lib/cucumber/ast/step.rb +6 -1
  33. data/lib/cucumber/ast/step_invocation.rb +14 -1
  34. data/lib/cucumber/ast/table.rb +30 -6
  35. data/lib/cucumber/cli/configuration.rb +1 -1
  36. data/lib/cucumber/cli/language_help_formatter.rb +27 -14
  37. data/lib/cucumber/cli/options.rb +2 -1
  38. data/lib/cucumber/cli/profile_loader.rb +12 -4
  39. data/lib/cucumber/core_ext/instance_exec.rb +29 -25
  40. data/lib/cucumber/formatter/junit.rb +50 -45
  41. data/lib/cucumber/formatter/pdf.rb +16 -4
  42. data/lib/cucumber/formatter/usage.rb +2 -14
  43. data/lib/cucumber/language_support/language_methods.rb +23 -3
  44. data/lib/cucumber/languages.yml +14 -0
  45. data/lib/cucumber/parser/natural_language.rb +1 -1
  46. data/lib/cucumber/parser/table.rb +10 -7
  47. data/lib/cucumber/parser/table.tt +1 -1
  48. data/lib/cucumber/platform.rb +1 -0
  49. data/lib/cucumber/py_support/py_dsl.py +10 -8
  50. data/lib/cucumber/py_support/py_language.py +8 -0
  51. data/lib/cucumber/py_support/py_language.rb +24 -11
  52. data/lib/cucumber/rails/action_controller.rb +6 -1
  53. data/lib/cucumber/rails/active_record.rb +5 -4
  54. data/lib/cucumber/rake/task.rb +7 -82
  55. data/lib/cucumber/rb_support/rb_language.rb +0 -4
  56. data/lib/cucumber/rb_support/rb_step_definition.rb +4 -6
  57. data/lib/cucumber/rb_support/rb_transform.rb +9 -7
  58. data/lib/cucumber/step_definition_light.rb +20 -0
  59. data/lib/cucumber/step_match.rb +1 -1
  60. data/lib/cucumber/step_mother.rb +5 -1
  61. data/lib/cucumber/version.rb +3 -3
  62. data/lib/cucumber/webrat/element_locator.rb +2 -0
  63. data/rails_generators/cucumber/cucumber_generator.rb +8 -9
  64. data/rails_generators/cucumber/templates/cucumber +14 -6
  65. data/rails_generators/cucumber/templates/cucumber.rake +9 -1
  66. data/rails_generators/cucumber/templates/cucumber_environment.rb +5 -1
  67. data/rails_generators/cucumber/templates/env.rb +29 -14
  68. data/rails_generators/cucumber/templates/paths.rb +1 -1
  69. data/rails_generators/cucumber/templates/spork_env.rb +39 -17
  70. data/rails_generators/cucumber/templates/version_check.rb +29 -0
  71. data/rails_generators/cucumber/templates/webrat_steps.rb +5 -0
  72. data/spec/cucumber/ast/outline_table_spec.rb +21 -0
  73. data/spec/cucumber/ast/table_spec.rb +18 -0
  74. data/spec/cucumber/formatter/html_spec.rb +33 -69
  75. data/spec/cucumber/formatter/junit_spec.rb +73 -0
  76. data/spec/cucumber/formatter/spec_helper.rb +50 -0
  77. data/spec/cucumber/parser/table_parser_spec.rb +2 -2
  78. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +10 -1
  79. data/spec/cucumber/step_mother_spec.rb +6 -0
  80. metadata +32 -8
  81. data/examples/python/features/support/env.rb +0 -21
@@ -0,0 +1,50 @@
1
+ module Cucumber
2
+ module Formatter
3
+
4
+ module SpecHelperDsl
5
+ attr_reader :feature_content, :step_defs
6
+
7
+ def define_feature(string)
8
+ @feature_content = string
9
+ end
10
+
11
+ def define_steps(&block)
12
+ @step_defs = block
13
+ end
14
+ end
15
+
16
+ module SpecHelper
17
+ def run_defined_feature
18
+ define_steps
19
+ features = load_features(self.class.feature_content || raise("No feature content defined!"))
20
+ run(features)
21
+ end
22
+
23
+ def step_mother
24
+ @step_mother ||= StepMother.new
25
+ end
26
+
27
+ def load_features(content)
28
+ feature_file = FeatureFile.new('spec.feature', content)
29
+ features = Ast::Features.new
30
+ features.add_feature feature_file.parse(@step_mother, {})
31
+ features
32
+ end
33
+
34
+ def run(features)
35
+ # options = { :verbose => true }
36
+ options = {}
37
+ tree_walker = Cucumber::Ast::TreeWalker.new(@step_mother, [@formatter], options, STDOUT)
38
+ tree_walker.visit_features(features)
39
+ end
40
+
41
+ def define_steps
42
+ return unless step_defs = self.class.step_defs
43
+ rb = @step_mother.load_programming_language('rb')
44
+ dsl = Object.new
45
+ dsl.extend RbSupport::RbDsl
46
+ dsl.instance_exec &step_defs
47
+ end
48
+ end
49
+ end
50
+ end
@@ -41,11 +41,11 @@ module Cucumber
41
41
  end
42
42
 
43
43
  it "should parse a 2x2 table with empty cells" do
44
- parse("| 1 | |\n|| 4 |\n").should == [['1', nil], [nil, '4']]
44
+ parse("| 1 | |\n|| 4 |\n").should == [['1', ''], ['', '4']]
45
45
  end
46
46
 
47
47
  it "should not parse a 2x2 table that isn't closed" do
48
- parse("| 1 | |\n|| 4 ").should_not == [['1', nil], [nil, '4']]
48
+ parse("| 1 | |\n|| 4 ").should_not == [['1', ''], ['', '4']]
49
49
  end
50
50
  end
51
51
  end
@@ -72,6 +72,15 @@ module Cucumber
72
72
 
73
73
  @step_mother.step_match("Loud").invoke(nil)
74
74
  end
75
+
76
+ it "should recognize $arg style captures" do
77
+ @dsl.Given "capture this: $arg" do |arg|
78
+ arg.should == 'this'
79
+ end
80
+
81
+ @step_mother.step_match('capture this: this').invoke(nil)
82
+ end
83
+
75
84
 
76
85
  def unindented(s)
77
86
  s.split("\n")[1..-2].join("\n").indent(-10)
@@ -92,7 +101,7 @@ module Cucumber
92
101
  end
93
102
  })
94
103
  end
95
-
104
+
96
105
  it "should not use quote group when there are no quotes" do
97
106
  @rb.snippet_text('Given', 'A first arg').should == unindented(%{
98
107
  Given /^A first arg$/ do
@@ -259,6 +259,12 @@ or http://wiki.github.com/aslakhellesoy/cucumber/a-whole-new-world.
259
259
  @dsl.Transform(/^transform_me$/) {|arg| :baz }
260
260
  @rb.execute_transforms(['transform_me']).should == [:baz]
261
261
  end
262
+
263
+ it "allows registering a transform which returns nil" do
264
+ @dsl.Transform('^ac$') {|arg| nil}
265
+ @rb.execute_transforms(['ab']).should == ['ab']
266
+ @rb.execute_transforms(['ac']).should == [nil]
267
+ end
262
268
  end
263
269
 
264
270
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.104
4
+ version: 0.4.0.rc1
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-09-28 00:00:00 +02:00
12
+ date: 2009-10-08 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -225,6 +225,11 @@ files:
225
225
  - examples/i18n/sk/features/division.feature
226
226
  - examples/i18n/sk/features/step_definitons/calculator_steps.rb
227
227
  - examples/i18n/sk/lib/calculator.rb
228
+ - examples/i18n/tr/Rakefile
229
+ - "examples/i18n/tr/features/bo\xCC\x88lme.feature"
230
+ - "examples/i18n/tr/features/step_definitons/hesap_makinesi_ad\xC4\xB1mlar\xC4\xB1.rb"
231
+ - examples/i18n/tr/features/toplama.feature
232
+ - examples/i18n/tr/lib/hesap_makinesi.rb
228
233
  - examples/i18n/uz/Rakefile
229
234
  - examples/i18n/uz/features/addition.feature
230
235
  - examples/i18n/uz/features/consecutive_calculations.feature
@@ -255,8 +260,6 @@ files:
255
260
  - examples/pure_java/README.textile
256
261
  - examples/python/features/fibonacci.feature
257
262
  - examples/python/features/step_definitions/fib_steps.py
258
- - examples/python/features/step_definitions/fib_steps.rb
259
- - examples/python/features/support/env.rb
260
263
  - examples/python/lib/fib.py
261
264
  - examples/ramaze/README.textile
262
265
  - examples/ramaze/Rakefile
@@ -266,6 +269,10 @@ files:
266
269
  - examples/ramaze/features/support/env.rb
267
270
  - examples/ramaze/layout/default.html.erb
268
271
  - examples/ramaze/view/index.html.erb
272
+ - examples/ruby2python/features/fibonacci.feature
273
+ - examples/ruby2python/features/step_definitions/fib_steps.rb
274
+ - examples/ruby2python/features/support/env.rb
275
+ - examples/ruby2python/lib/fib.py
269
276
  - examples/selenium/Rakefile
270
277
  - examples/selenium/features/search.feature
271
278
  - examples/selenium/features/step_definitons/search_steps.rb
@@ -350,6 +357,7 @@ files:
350
357
  - examples/watir/features/support/env.rb
351
358
  - features/background.feature
352
359
  - features/bug_371.feature
360
+ - features/bug_475.feature
353
361
  - features/cucumber_cli.feature
354
362
  - features/cucumber_cli_diff_disabled.feature
355
363
  - features/cucumber_cli_outlines.feature
@@ -365,17 +373,22 @@ files:
365
373
  - features/html_formatter/a.html
366
374
  - features/junit_formatter.feature
367
375
  - features/language_from_header.feature
376
+ - features/language_help.feature
368
377
  - features/multiline_names.feature
369
378
  - features/negative_tagged_hooks.feature
370
379
  - features/post_configuration_hook.feature
371
380
  - features/profiles.feature
372
381
  - features/rake_task.feature
373
382
  - features/report_called_undefined_steps.feature
383
+ - features/simplest.feature
374
384
  - features/snippet.feature
375
385
  - features/step_definitions/cucumber_steps.rb
376
386
  - features/step_definitions/extra_steps.rb
387
+ - features/step_definitions/simplest_steps.rb
377
388
  - features/support/env.rb
389
+ - features/support/env.rb.simplest
378
390
  - features/table_diffing.feature
391
+ - features/table_mapping.feature
379
392
  - features/transform.feature
380
393
  - features/unicode_table.feature
381
394
  - features/usage_and_stepdefs_formatter.feature
@@ -478,6 +491,7 @@ files:
478
491
  - lib/cucumber/rb_support/regexp_argument_matcher.rb
479
492
  - lib/cucumber/rspec_neuter.rb
480
493
  - lib/cucumber/step_argument.rb
494
+ - lib/cucumber/step_definition_light.rb
481
495
  - lib/cucumber/step_match.rb
482
496
  - lib/cucumber/step_mother.rb
483
497
  - lib/cucumber/version.rb
@@ -491,6 +505,7 @@ files:
491
505
  - rails_generators/cucumber/templates/env.rb
492
506
  - rails_generators/cucumber/templates/paths.rb
493
507
  - rails_generators/cucumber/templates/spork_env.rb
508
+ - rails_generators/cucumber/templates/version_check.rb
494
509
  - rails_generators/cucumber/templates/webrat_steps.rb
495
510
  - rails_generators/feature/USAGE
496
511
  - rails_generators/feature/feature_generator.rb
@@ -500,6 +515,7 @@ files:
500
515
  - spec/cucumber/ast/feature_element_spec.rb
501
516
  - spec/cucumber/ast/feature_factory.rb
502
517
  - spec/cucumber/ast/feature_spec.rb
518
+ - spec/cucumber/ast/outline_table_spec.rb
503
519
  - spec/cucumber/ast/py_string_spec.rb
504
520
  - spec/cucumber/ast/scenario_outline_spec.rb
505
521
  - spec/cucumber/ast/scenario_spec.rb
@@ -518,7 +534,9 @@ files:
518
534
  - spec/cucumber/formatter/color_io_spec.rb
519
535
  - spec/cucumber/formatter/duration_spec.rb
520
536
  - spec/cucumber/formatter/html_spec.rb
537
+ - spec/cucumber/formatter/junit_spec.rb
521
538
  - spec/cucumber/formatter/progress_spec.rb
539
+ - spec/cucumber/formatter/spec_helper.rb
522
540
  - spec/cucumber/parser/feature_parser_spec.rb
523
541
  - spec/cucumber/parser/table_parser_spec.rb
524
542
  - spec/cucumber/rb_support/rb_step_definition_spec.rb
@@ -546,7 +564,13 @@ has_rdoc: true
546
564
  homepage: http://cukes.info
547
565
  licenses: []
548
566
 
549
- post_install_message:
567
+ post_install_message: |
568
+ *******************************************************************************
569
+ Thank you for installing cucumber-0.4.0.rc1
570
+ Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
571
+ for important information about this release.
572
+ *******************************************************************************
573
+
550
574
  rdoc_options:
551
575
  - --main
552
576
  - README.txt
@@ -560,14 +584,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
560
584
  version:
561
585
  required_rubygems_version: !ruby/object:Gem::Requirement
562
586
  requirements:
563
- - - ">="
587
+ - - ">"
564
588
  - !ruby/object:Gem::Version
565
- version: "0"
589
+ version: 1.3.1
566
590
  version:
567
591
  requirements: []
568
592
 
569
593
  rubyforge_project: rspec
570
- rubygems_version: 1.3.4
594
+ rubygems_version: 1.3.5
571
595
  signing_key:
572
596
  specification_version: 3
573
597
  summary: Executable Feature scenarios
@@ -1,21 +0,0 @@
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