aslakhellesoy-cucumber 0.1.99.13 → 0.1.99.14

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 CHANGED
@@ -75,7 +75,7 @@ pure Ruby users have been enjoying for a while.
75
75
  * Pending steps in > steps called from steps (#65 Aslak Hellesøy)
76
76
 
77
77
  === New features
78
- * Keywords can be aliased in languages.yml. See English for an example (scenarios: Scenarios|Examples)
78
+ * Keywords can be aliased in languages.yml. See English for an example (examples: Examples|Scenarios)
79
79
  * Adding support for Background (#153 Joseph Wilk)
80
80
  * Added Česky/Czech (Vojtech Salbaba)
81
81
  * New --no-multiline option to reduce noise. Useful if lots of features are failing.
data/Manifest.txt CHANGED
@@ -117,6 +117,7 @@ examples/selenium/Rakefile
117
117
  examples/selenium/features/search.feature
118
118
  examples/selenium/features/step_definitons/stories_steps.rb
119
119
  examples/self_test/README.textile
120
+ examples/self_test/Rakefile
120
121
  examples/self_test/features/background/failing_background.feature
121
122
  examples/self_test/features/background/failing_background_after_success.feature
122
123
  examples/self_test/features/background/multiline_args_background.feature
@@ -217,7 +218,6 @@ lib/cucumber/rake/task.rb
217
218
  lib/cucumber/step_definition.rb
218
219
  lib/cucumber/step_mother.rb
219
220
  lib/cucumber/version.rb
220
- pom.xml
221
221
  rails_generators/cucumber/USAGE
222
222
  rails_generators/cucumber/cucumber_generator.rb
223
223
  rails_generators/cucumber/templates/cucumber
@@ -272,4 +272,3 @@ spec/cucumber/treetop_parser/with_tags.feature
272
272
  spec/cucumber/world/pending_spec.rb
273
273
  spec/spec.opts
274
274
  spec/spec_helper.rb
275
- src/main/java/cukes/Cucumber.java
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new
5
+
6
+ task :default => :features
@@ -43,8 +43,8 @@ Feature: Cucumber command line
43
43
  Feature: Outline Sample
44
44
 
45
45
  Scenario Outline: Test state # features/outline_sample.feature:5
46
- Given <state> without a table
47
- Given <other_state> without a table
46
+ Given <state> without a table # features/step_definitions/sample_steps.rb:12
47
+ Given <other_state> without a table # features/step_definitions/sample_steps.rb:12
48
48
 
49
49
  Examples: Rainbow colours
50
50
  | state | other_state |
@@ -4,7 +4,7 @@ namespace :gemspec do
4
4
  File.open('cucumber.gemspec', 'w') {|io| io.write($hoe.spec.to_ruby)}
5
5
  puts "1) git commit -a -m \"Release #{Cucumber::VERSION::STRING}\""
6
6
  puts "2) git tag -a \"v#{Cucumber::VERSION::STRING}\" -m \"Release #{Cucumber::VERSION::STRING}\""
7
- puts "3) git push --tags"
8
- puts "4) Bounce the version in version.rb"
7
+ puts "3) git push"
8
+ puts "4) git push --tags"
9
9
  end
10
10
  end
@@ -10,6 +10,10 @@ module Cucumber
10
10
  @outline_table.accept(visitor, nil)
11
11
  end
12
12
 
13
+ def each_example_row(&proc)
14
+ @outline_table.each_cells_row(&proc)
15
+ end
16
+
13
17
  def at_lines?(lines)
14
18
  lines.empty? || lines.index(@line) || @outline_table.at_lines?(lines)
15
19
  end
@@ -39,6 +39,12 @@ module Cucumber
39
39
  end
40
40
  end
41
41
 
42
+ def each_example_row(&proc)
43
+ @examples_array.each do |examples|
44
+ examples.each_example_row(&proc)
45
+ end
46
+ end
47
+
42
48
  def execute_row(cells, visitor, &proc)
43
49
  exception = nil
44
50
 
@@ -26,13 +26,31 @@ module Cucumber
26
26
 
27
27
  def accept(visitor)
28
28
  execute(visitor)
29
- visitor.visit_step_name(@keyword, @name, @status, @step_definition, source_indent)
29
+
30
+ if @status == :outline
31
+ step_definition = find_first_name_and_step_definition_from_examples(visitor)
32
+ else
33
+ step_definition = @step_definition
34
+ end
35
+ visitor.visit_step_name(@keyword, @name, @status, step_definition, source_indent)
30
36
  @multiline_args.each do |multiline_arg|
31
37
  visitor.visit_multiline_arg(multiline_arg, @status)
32
38
  end
33
39
  @exception
34
40
  end
35
41
 
42
+ def find_first_name_and_step_definition_from_examples(visitor)
43
+ # @scenario is always a ScenarioOutline in this case
44
+ @scenario.each_example_row do |cells|
45
+ argument_hash = cells.to_hash
46
+ delimited_arguments = delimit_argument_names(argument_hash)
47
+ name = replace_name_arguments(delimited_arguments)
48
+ step_definition = visitor.step_definition(name) rescue nil
49
+ return step_definition if step_definition
50
+ end
51
+ nil
52
+ end
53
+
36
54
  def to_sexp
37
55
  [:step, @line, @keyword, @name, *@multiline_args.map{|arg| arg.to_sexp}]
38
56
  end
@@ -66,6 +66,10 @@ module Cucumber
66
66
  @raw[1..-1]
67
67
  end
68
68
 
69
+ def each_cells_row(&proc)
70
+ cells_rows.each(&proc)
71
+ end
72
+
69
73
  # For testing only
70
74
  def to_sexp #:nodoc:
71
75
  [:table, *cells_rows.map{|row| row.to_sexp}]
@@ -7,17 +7,20 @@ module Cucumber
7
7
  FORMATS = Hash.new{|hash, format| hash[format] = method(format).to_proc}
8
8
 
9
9
  def format_step(keyword, step_name, status, step_definition, source_indent)
10
- line = if step_definition # nil for :outline
11
- comment = if source_indent
12
- c = (' # ' + step_definition.file_colon_line).indent(source_indent)
13
- format_string(c, :comment)
14
- else
15
- ''
16
- end
17
- keyword + " " + step_definition.format_args(step_name, format_for(status, :param)) + comment
10
+ comment = if source_indent
11
+ c = (' # ' + step_definition.file_colon_line).indent(source_indent)
12
+ format_string(c, :comment)
18
13
  else
19
- keyword + " " + step_name
14
+ ''
20
15
  end
16
+
17
+ begin
18
+ line = keyword + " " + step_definition.format_args(step_name, format_for(status, :param)) + comment
19
+ rescue
20
+ # It didn't match. This often happens for :outline steps
21
+ line = keyword + " " + step_name + comment
22
+ end
23
+
21
24
  format_string(line, status)
22
25
  end
23
26
 
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 99
6
- PATCH = 13 # Set to nil for official release
6
+ PATCH = 14 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
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.99.13
4
+ version: 0.1.99.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -181,6 +181,7 @@ files:
181
181
  - examples/selenium/features/search.feature
182
182
  - examples/selenium/features/step_definitons/stories_steps.rb
183
183
  - examples/self_test/README.textile
184
+ - examples/self_test/Rakefile
184
185
  - examples/self_test/features/background/failing_background.feature
185
186
  - examples/self_test/features/background/failing_background_after_success.feature
186
187
  - examples/self_test/features/background/multiline_args_background.feature