aslakhellesoy-cucumber 0.3.103 → 0.3.104

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/History.txt +27 -2
  2. data/Manifest.txt +10 -4
  3. data/examples/ramaze/README.textile +7 -0
  4. data/examples/ramaze/Rakefile +6 -0
  5. data/examples/ramaze/app.rb +21 -0
  6. data/examples/ramaze/features/add.feature +11 -0
  7. data/examples/ramaze/features/step_definitions/add_steps.rb +15 -0
  8. data/examples/ramaze/features/support/env.rb +32 -0
  9. data/examples/ramaze/layout/default.html.erb +8 -0
  10. data/examples/ramaze/view/index.html.erb +5 -0
  11. data/examples/sinatra/features/support/env.rb +1 -1
  12. data/features/cucumber_cli.feature +5 -5
  13. data/features/usage_and_stepdefs_formatter.feature +169 -0
  14. data/lib/cucumber/ast/step_invocation.rb +7 -0
  15. data/lib/cucumber/ast/tags.rb +6 -1
  16. data/lib/cucumber/ast/tree_walker.rb +179 -0
  17. data/lib/cucumber/cli/options.rb +20 -11
  18. data/lib/cucumber/formatter/html.rb +0 -2
  19. data/lib/cucumber/formatter/stepdefs.rb +14 -0
  20. data/lib/cucumber/formatter/usage.rb +106 -50
  21. data/lib/cucumber/language_support/language_methods.rb +6 -9
  22. data/lib/cucumber/rb_support/rb_language.rb +16 -3
  23. data/lib/cucumber/rb_support/rb_step_definition.rb +7 -1
  24. data/lib/cucumber/step_match.rb +4 -0
  25. data/lib/cucumber/step_mother.rb +8 -37
  26. data/lib/cucumber/version.rb +1 -1
  27. data/spec/cucumber/ast/background_spec.rb +0 -6
  28. data/spec/cucumber/ast/tree_walker_spec.rb +11 -0
  29. data/spec/cucumber/cli/options_spec.rb +12 -0
  30. data/spec/cucumber/formatter/html_spec.rb +0 -1
  31. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -9
  32. data/spec/cucumber/step_mother_spec.rb +13 -34
  33. metadata +14 -6
  34. data/features/steps_formatter.feature +0 -26
  35. data/features/usage.feature +0 -126
  36. data/lib/cucumber/formatter/profile.rb +0 -78
  37. data/lib/cucumber/formatters/unicode.rb +0 -7
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.3.103
4
+ version: 0.3.104
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-24 00:00:00 -07:00
12
+ date: 2009-09-28 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -258,6 +258,14 @@ files:
258
258
  - examples/python/features/step_definitions/fib_steps.rb
259
259
  - examples/python/features/support/env.rb
260
260
  - examples/python/lib/fib.py
261
+ - examples/ramaze/README.textile
262
+ - examples/ramaze/Rakefile
263
+ - examples/ramaze/app.rb
264
+ - examples/ramaze/features/add.feature
265
+ - examples/ramaze/features/step_definitions/add_steps.rb
266
+ - examples/ramaze/features/support/env.rb
267
+ - examples/ramaze/layout/default.html.erb
268
+ - examples/ramaze/view/index.html.erb
261
269
  - examples/selenium/Rakefile
262
270
  - examples/selenium/features/search.feature
263
271
  - examples/selenium/features/step_definitons/search_steps.rb
@@ -366,12 +374,11 @@ files:
366
374
  - features/snippet.feature
367
375
  - features/step_definitions/cucumber_steps.rb
368
376
  - features/step_definitions/extra_steps.rb
369
- - features/steps_formatter.feature
370
377
  - features/support/env.rb
371
378
  - features/table_diffing.feature
372
379
  - features/transform.feature
373
380
  - features/unicode_table.feature
374
- - features/usage.feature
381
+ - features/usage_and_stepdefs_formatter.feature
375
382
  - features/work_in_progress.feature
376
383
  - gem_tasks/contributors.rake
377
384
  - gem_tasks/deployment.rake
@@ -407,6 +414,7 @@ files:
407
414
  - lib/cucumber/ast/step_invocation.rb
408
415
  - lib/cucumber/ast/table.rb
409
416
  - lib/cucumber/ast/tags.rb
417
+ - lib/cucumber/ast/tree_walker.rb
410
418
  - lib/cucumber/ast/visitor.rb
411
419
  - lib/cucumber/broadcaster.rb
412
420
  - lib/cucumber/cli/configuration.rb
@@ -432,14 +440,13 @@ files:
432
440
  - lib/cucumber/formatter/ordered_xml_markup.rb
433
441
  - lib/cucumber/formatter/pdf.rb
434
442
  - lib/cucumber/formatter/pretty.rb
435
- - lib/cucumber/formatter/profile.rb
436
443
  - lib/cucumber/formatter/progress.rb
437
444
  - lib/cucumber/formatter/rerun.rb
445
+ - lib/cucumber/formatter/stepdefs.rb
438
446
  - lib/cucumber/formatter/steps.rb
439
447
  - lib/cucumber/formatter/tag_cloud.rb
440
448
  - lib/cucumber/formatter/unicode.rb
441
449
  - lib/cucumber/formatter/usage.rb
442
- - lib/cucumber/formatters/unicode.rb
443
450
  - lib/cucumber/language_support.rb
444
451
  - lib/cucumber/language_support/language_methods.rb
445
452
  - lib/cucumber/language_support/step_definition_methods.rb
@@ -499,6 +506,7 @@ files:
499
506
  - spec/cucumber/ast/step_collection_spec.rb
500
507
  - spec/cucumber/ast/step_spec.rb
501
508
  - spec/cucumber/ast/table_spec.rb
509
+ - spec/cucumber/ast/tree_walker_spec.rb
502
510
  - spec/cucumber/broadcaster_spec.rb
503
511
  - spec/cucumber/cli/configuration_spec.rb
504
512
  - spec/cucumber/cli/drb_client_spec.rb
@@ -1,26 +0,0 @@
1
- Feature: --formatter steps option - Steps Formatter
2
- In order to easily see which steps are already defined,
3
- specially when using 3rd party steps libraries,
4
- Cucumber should show the available steps in a user-friendly format
5
-
6
- Background:
7
- Given I am in steps_library
8
-
9
- Scenario: Printing steps
10
- When I run cucumber -f steps features
11
- Then STDERR should be empty
12
- And it should pass with
13
- """
14
- features/step_definitions/steps_lib1.rb
15
- /^I defined a first step$/ # features/step_definitions/steps_lib1.rb:1
16
- /^I define a second step$/ # features/step_definitions/steps_lib1.rb:4
17
- /^I should also have a third step$/ # features/step_definitions/steps_lib1.rb:7
18
-
19
- features/step_definitions/steps_lib2.rb
20
- /^I defined a step 4$/ # features/step_definitions/steps_lib2.rb:1
21
- /^I create a step 5$/ # features/step_definitions/steps_lib2.rb:4
22
- /^I should be too tired for step 6$/ # features/step_definitions/steps_lib2.rb:7
23
-
24
- 6 step definition(s) in 2 source file(s).
25
-
26
- """
@@ -1,126 +0,0 @@
1
- Feature: Cucumber command line
2
- In order to be able to write an editor plugin that can jump between
3
- steps and step definitions, Cucumber must provide a way to
4
- display how they are related.
5
-
6
- @mri186
7
- Scenario: List usage of step definitions
8
- When I run cucumber features --format usage --dry-run
9
- Then it should pass with
10
- """
11
- /^passing without a table$/ # features/step_definitions/sample_steps.rb:12
12
- Given <other_state> without a table # features/outline_sample.feature:7
13
- Given <state> without a table # features/multiline_name.feature:16
14
- Given <state> without a table # features/multiline_name.feature:22
15
- Given <state> without a table # features/outline_sample.feature:6
16
- Given <state> without a table # features/search_sample.feature:19
17
- Given <state> without a table # features/search_sample.feature:25
18
- Given passing without a table # features/background/background_tagged_before_on_outline.feature:5
19
- Given passing without a table # features/background/failing_background_after_success.feature:4
20
- Given passing without a table # features/multiline_name.feature:11
21
- Given passing without a table # features/multiline_name.feature:6
22
- Given passing without a table # features/search_sample.feature:4
23
- Given passing without a table # features/search_sample.feature:7
24
- /^failing without a table$/ # features/step_definitions/sample_steps.rb:15
25
- Given <state> without a table # features/search_sample.feature:13
26
- Given failing without a table # features/background/failing_background.feature:5
27
- Given failing without a table # features/background/scenario_outline_failing_background.feature:4
28
- Given failing without a table # features/search_sample.feature:10
29
- /^a step definition that calls an undefined step$/ # features/step_definitions/sample_steps.rb:19
30
- Given a step definition that calls an undefined step # features/call_undefined_step_from_step_def.feature:4
31
- /^call step "(.*)"$/ # features/step_definitions/sample_steps.rb:23
32
- Given call step "a step definition that calls an undefined step" # features/call_undefined_step_from_step_def.feature:7
33
- /^'(.+)' cukes$/ # features/step_definitions/sample_steps.rb:27
34
- And '10' cukes # features/background/failing_background.feature:6
35
- Given '10' cukes # features/background/background_with_name.feature:4
36
- Given '10' cukes # features/background/passing_background.feature:4
37
- Given '10' cukes # features/background/scenario_outline_passing_background.feature:4
38
- Given '2' cukes # features/tons_of_cukes.feature:10
39
- Given '2' cukes # features/tons_of_cukes.feature:11
40
- Given '2' cukes # features/tons_of_cukes.feature:12
41
- Given '2' cukes # features/tons_of_cukes.feature:13
42
- Given '2' cukes # features/tons_of_cukes.feature:14
43
- Given '2' cukes # features/tons_of_cukes.feature:15
44
- Given '2' cukes # features/tons_of_cukes.feature:16
45
- Given '2' cukes # features/tons_of_cukes.feature:17
46
- Given '2' cukes # features/tons_of_cukes.feature:18
47
- Given '2' cukes # features/tons_of_cukes.feature:19
48
- Given '2' cukes # features/tons_of_cukes.feature:20
49
- Given '2' cukes # features/tons_of_cukes.feature:21
50
- Given '2' cukes # features/tons_of_cukes.feature:22
51
- Given '2' cukes # features/tons_of_cukes.feature:23
52
- Given '2' cukes # features/tons_of_cukes.feature:24
53
- Given '2' cukes # features/tons_of_cukes.feature:25
54
- Given '2' cukes # features/tons_of_cukes.feature:26
55
- Given '2' cukes # features/tons_of_cukes.feature:27
56
- Given '2' cukes # features/tons_of_cukes.feature:28
57
- Given '2' cukes # features/tons_of_cukes.feature:29
58
- Given '2' cukes # features/tons_of_cukes.feature:30
59
- Given '2' cukes # features/tons_of_cukes.feature:31
60
- Given '2' cukes # features/tons_of_cukes.feature:32
61
- Given '2' cukes # features/tons_of_cukes.feature:33
62
- Given '2' cukes # features/tons_of_cukes.feature:34
63
- Given '2' cukes # features/tons_of_cukes.feature:35
64
- Given '2' cukes # features/tons_of_cukes.feature:36
65
- Given '2' cukes # features/tons_of_cukes.feature:37
66
- Given '2' cukes # features/tons_of_cukes.feature:38
67
- Given '2' cukes # features/tons_of_cukes.feature:39
68
- Given '2' cukes # features/tons_of_cukes.feature:4
69
- Given '2' cukes # features/tons_of_cukes.feature:40
70
- Given '2' cukes # features/tons_of_cukes.feature:41
71
- Given '2' cukes # features/tons_of_cukes.feature:42
72
- Given '2' cukes # features/tons_of_cukes.feature:43
73
- Given '2' cukes # features/tons_of_cukes.feature:44
74
- Given '2' cukes # features/tons_of_cukes.feature:45
75
- Given '2' cukes # features/tons_of_cukes.feature:46
76
- Given '2' cukes # features/tons_of_cukes.feature:47
77
- Given '2' cukes # features/tons_of_cukes.feature:48
78
- Given '2' cukes # features/tons_of_cukes.feature:49
79
- Given '2' cukes # features/tons_of_cukes.feature:5
80
- Given '2' cukes # features/tons_of_cukes.feature:50
81
- Given '2' cukes # features/tons_of_cukes.feature:51
82
- Given '2' cukes # features/tons_of_cukes.feature:52
83
- Given '2' cukes # features/tons_of_cukes.feature:6
84
- Given '2' cukes # features/tons_of_cukes.feature:7
85
- Given '2' cukes # features/tons_of_cukes.feature:8
86
- Given '2' cukes # features/tons_of_cukes.feature:9
87
- /^I should have '(.+)' cukes$/ # features/step_definitions/sample_steps.rb:31
88
- Then I should have '10' cukes # features/background/background_with_name.feature:7
89
- Then I should have '10' cukes # features/background/failing_background.feature:12
90
- Then I should have '10' cukes # features/background/failing_background.feature:9
91
- Then I should have '10' cukes # features/background/passing_background.feature:10
92
- Then I should have '10' cukes # features/background/passing_background.feature:7
93
- Then I should have '10' cukes # features/background/pending_background.feature:10
94
- Then I should have '10' cukes # features/background/pending_background.feature:7
95
- Then I should have '<count>' cukes # features/background/background_tagged_before_on_outline.feature:8
96
- Then I should have '<count>' cukes # features/background/scenario_outline_failing_background.feature:13
97
- Then I should have '<count>' cukes # features/background/scenario_outline_failing_background.feature:7
98
- Then I should have '<count>' cukes # features/background/scenario_outline_passing_background.feature:13
99
- Then I should have '<count>' cukes # features/background/scenario_outline_passing_background.feature:7
100
- /^'(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:35
101
- And '10' global cukes # features/background/failing_background_after_success.feature:5
102
- /^I should have '(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:42
103
- Then I should have '10' global cukes # features/background/failing_background_after_success.feature:11
104
- Then I should have '10' global cukes # features/background/failing_background_after_success.feature:8
105
- /^table$/ # features/step_definitions/sample_steps.rb:46
106
- Given table # features/background/multiline_args_background.feature:4
107
- /^multiline string$/ # features/step_definitions/sample_steps.rb:50
108
- And multiline string # features/background/multiline_args_background.feature:7
109
- /^the table should be$/ # features/step_definitions/sample_steps.rb:54
110
- Then the table should be # features/background/multiline_args_background.feature:14
111
- Then the table should be # features/background/multiline_args_background.feature:24
112
- /^the multiline string should be$/ # features/step_definitions/sample_steps.rb:58
113
- Then the multiline string should be # features/background/multiline_args_background.feature:17
114
- Then the multiline string should be # features/background/multiline_args_background.feature:27
115
- /^passing$/ # features/step_definitions/sample_steps.rb:5
116
- Given passing # features/sample.feature:12
117
- /^failing expectation$/ # features/step_definitions/sample_steps.rb:62
118
- Given failing expectation # features/failing_expectation.feature:4
119
- /^failing$/ # features/step_definitions/sample_steps.rb:8
120
- Given failing # features/sample.feature:18
121
- (::) UNUSED (::)
122
- /^unused$/ # features/step_definitions/sample_steps.rb:66
123
- /^another unused$/ # features/step_definitions/sample_steps.rb:69
124
-
125
- """
126
-
@@ -1,78 +0,0 @@
1
- require 'cucumber/formatter/progress'
2
-
3
- module Cucumber
4
- module Formatter
5
- # The formatter used for <tt>--format profile</tt>
6
- class Profile < Progress
7
- NUMBER_OF_STEP_DEFINITONS_TO_SHOW = 10
8
- NUMBER_OF_STEP_INVOCATIONS_TO_SHOW = 5
9
-
10
- def initialize(step_mother, io, options)
11
- super
12
- @step_definition_durations = Hash.new { |h,step_definition| h[step_definition] = [] }
13
- end
14
-
15
- def step(step)
16
- @step_duration = Time.now
17
- @step = step
18
- super
19
- end
20
-
21
- def step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
22
- duration = Time.now - @step_duration
23
- super
24
-
25
- if step_match.step_definition
26
- description = format_step(keyword, step_match, status, nil)
27
- @step_definition_durations[step_match.step_definition] << [duration, description, @step.file_colon_line]
28
- end
29
- end
30
-
31
- def print_summary(features)
32
- super
33
- @io.puts "\n\nTop #{NUMBER_OF_STEP_DEFINITONS_TO_SHOW} average slowest steps with #{NUMBER_OF_STEP_INVOCATIONS_TO_SHOW} slowest matches:\n"
34
-
35
- mean_durations = map_to_mean_durations(@step_definition_durations)
36
- mean_durations = mean_durations.sort_by do |duration_description_location, step_definition, mean_duration|
37
- mean_duration
38
- end.reverse
39
-
40
- mean_durations[0...NUMBER_OF_STEP_DEFINITONS_TO_SHOW].each do |duration_description_location, step_definition, mean_duration|
41
- print_step_definition(step_definition, mean_duration)
42
- duration_description_location = duration_description_location.sort_by do |duration, description, location|
43
- duration
44
- end.reverse
45
- print_step_definitions(duration_description_location, step_definition)
46
- end
47
- end
48
-
49
- private
50
-
51
- def map_to_mean_durations(step_definition_durations)
52
- mean_durations = []
53
- step_definition_durations.each do |step_definition, duration_description_location|
54
- total_duration = duration_description_location.inject(0) { |sum, step_details| step_details[0] + sum }
55
- mean_duration = total_duration / duration_description_location.length
56
-
57
- mean_durations << [duration_description_location, step_definition, mean_duration]
58
- end
59
- mean_durations
60
- end
61
-
62
- def print_step_definition(step_definition, mean_duration)
63
- duration = sprintf("%.7f", mean_duration)
64
- @io.puts format_string("#{duration} #{step_definition.backtrace_line}", :failed)
65
- end
66
-
67
- def print_step_definitions(duration_description_location, step_definition)
68
- max_length = duration_description_location[0...NUMBER_OF_STEP_INVOCATIONS_TO_SHOW].map{|_, d, _| d.jlength}.max
69
- duration_description_location[0...NUMBER_OF_STEP_INVOCATIONS_TO_SHOW].each do |duration, description, location|
70
- @io.print format_string(" #{sprintf("%.7f", duration)}", :pending)
71
- @io.print " #{description}"
72
- @io.print format_string(" # #{location}".indent(max_length - description.jlength), :comment)
73
- @io.puts
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,7 +0,0 @@
1
- STDERR.puts <<-EOF
2
- WARNING: The cucumber/formatters/unicode file is deprecated.
3
- It will be removed in version 0.4.0
4
- Please use cucumber/formatter/unicode instead
5
- EOF
6
- # This is for backwards compatibility
7
- require 'cucumber/formatter/unicode'