cucumber 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,2 @@
1
1
  source "http://rubygems.org"
2
-
3
- group :development do
4
- # gem 'gherkin', :path => '../gherkin'
5
- end
6
-
7
2
  gemspec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cucumber (1.0.0)
4
+ cucumber (1.0.1)
5
5
  builder (>= 2.1.2)
6
6
  diff-lcs (>= 1.1.2)
7
7
  gherkin (~> 2.4.5)
data/History.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [v1.0.2](https://github.com/cucumber/cucumber/compare/v1.0.1...v1.0.2)
2
+
3
+ ### Bugfixes
4
+ * Cucumber 1.0.1 breaks cuke4duke ([#104](https://github.com/cucumber/cucumber/issues/104) Aslak Hellesøy)
5
+
6
+ ### New Features
7
+ * Better line truncation if $CUCUMBER_TRUNCATE_OUTPUT has a max line length value. (Aslak Hellesøy)
8
+
9
+ ### Changes Features
10
+ * --no-source also excludes location from the summary. (Aslak Hellesøy)
11
+
1
12
  ## [v1.0.1](https://github.com/cucumber/cucumber/compare/v1.0.0...v1.0.1)
2
13
 
3
14
  ### Bugfixes
@@ -299,7 +299,7 @@ Feature: Background
299
299
  Then I should have '10' cukes
300
300
 
301
301
  Failing Scenarios:
302
- cucumber features/failing_background.feature:7 # Scenario: failing background
302
+ cucumber features/failing_background.feature:7
303
303
 
304
304
  2 scenarios (1 failed, 1 skipped)
305
305
  6 steps (1 failed, 5 skipped)
@@ -335,7 +335,7 @@ Feature: Background
335
335
  | 10 |
336
336
 
337
337
  Failing Scenarios:
338
- cucumber features/scenario_outline_failing_background.feature:6 # Scenario: failing background
338
+ cucumber features/scenario_outline_failing_background.feature:6
339
339
 
340
340
  2 scenarios (1 failed, 1 skipped)
341
341
  4 steps (1 failed, 3 skipped)
@@ -386,7 +386,7 @@ Feature: Background
386
386
  Then I should have '10' global cukes
387
387
 
388
388
  Failing Scenarios:
389
- cucumber features/failing_background_after_success.feature:10 # Scenario: failing background
389
+ cucumber features/failing_background_after_success.feature:10
390
390
 
391
391
  2 scenarios (1 failed, 1 passed)
392
392
  6 steps (1 failed, 1 skipped, 4 passed)
@@ -58,9 +58,9 @@ Feature: Tag logic
58
58
  Scenario: And yet another Example
59
59
 
60
60
  Failing Scenarios:
61
- cucumber features/tagulicious.feature:4 # Scenario: Example
62
- cucumber features/tagulicious.feature:8 # Scenario: Another Example
63
- cucumber features/tagulicious.feature:12 # Scenario: Yet another Example
61
+ cucumber features/tagulicious.feature:4
62
+ cucumber features/tagulicious.feature:8
63
+ cucumber features/tagulicious.feature:12
64
64
 
65
65
  4 scenarios (3 failed, 1 passed)
66
66
  3 steps (3 undefined)
@@ -97,7 +97,7 @@ Feature: Tag logic
97
97
  Scenario: And yet another Example
98
98
 
99
99
  Failing Scenarios:
100
- cucumber features/tagulicious.feature:4 # Scenario: Example
100
+ cucumber features/tagulicious.feature:4
101
101
 
102
102
  4 scenarios (1 failed, 2 undefined, 1 passed)
103
103
  3 steps (3 undefined)
@@ -170,9 +170,9 @@ Feature: Tag logic
170
170
  Scenario: And yet another Example
171
171
 
172
172
  Failing Scenarios:
173
- cucumber features/tagulicious.feature:4 # Scenario: Example
174
- cucumber features/tagulicious.feature:8 # Scenario: Another Example
175
- cucumber features/tagulicious.feature:12 # Scenario: Yet another Example
173
+ cucumber features/tagulicious.feature:4
174
+ cucumber features/tagulicious.feature:8
175
+ cucumber features/tagulicious.feature:12
176
176
 
177
177
  4 scenarios (3 failed, 1 passed)
178
178
  3 steps (3 undefined)
@@ -209,7 +209,7 @@ Feature: Tag logic
209
209
  Scenario: And yet another Example
210
210
 
211
211
  Failing Scenarios:
212
- cucumber features/tagulicious.feature:4 # Scenario: Example
212
+ cucumber features/tagulicious.feature:4
213
213
 
214
214
  4 scenarios (1 failed, 2 undefined, 1 passed)
215
215
  3 steps (3 undefined)
@@ -82,7 +82,7 @@ Feature: Cucumber command line
82
82
  features/sample.feature:18:in `Given failing'
83
83
 
84
84
  Failing Scenarios:
85
- cucumber features/sample.feature:17 # Scenario: Failing
85
+ cucumber features/sample.feature:17
86
86
 
87
87
  2 scenarios (1 failed, 1 undefined)
88
88
  2 steps (1 failed, 1 undefined)
@@ -160,7 +160,7 @@ Feature: Cucumber command line
160
160
  features/sample.feature:18:in `Given failing'
161
161
 
162
162
  Failing Scenarios:
163
- cucumber features/sample.feature:17 # Scenario: Failing
163
+ cucumber features/sample.feature:17
164
164
 
165
165
  3 scenarios (1 failed, 1 undefined, 1 passed)
166
166
  3 steps (1 failed, 1 undefined, 1 passed)
@@ -464,7 +464,7 @@ Feature: Cucumber command line
464
464
  features/sample.feature:18:in `Given failing'
465
465
 
466
466
  Failing Scenarios:
467
- cucumber features/sample.feature:17 # Scenario: Failing
467
+ cucumber features/sample.feature:17
468
468
 
469
469
  3 scenarios (1 failed, 1 undefined, 1 passed)
470
470
  3 steps (1 failed, 1 undefined, 1 passed)
@@ -27,7 +27,7 @@ Feature: Cucumber command line
27
27
  | passing | passing |
28
28
 
29
29
  Failing Scenarios:
30
- cucumber features/outline_sample.feature:5 # Scenario: Test state
30
+ cucumber features/outline_sample.feature:5
31
31
 
32
32
  4 scenarios (1 failed, 1 undefined, 2 passed)
33
33
  8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
@@ -59,7 +59,7 @@ Feature: Cucumber command line
59
59
  | passing | passing |
60
60
 
61
61
  Failing Scenarios:
62
- cucumber features/outline_sample.feature:5 # Scenario: Test state
62
+ cucumber features/outline_sample.feature:5
63
63
 
64
64
  4 scenarios (1 failed, 1 undefined, 2 passed)
65
65
  8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
@@ -108,7 +108,7 @@ Feature: Cucumber command line
108
108
  features/outline_sample.feature:6:in `Given <state> without a table'
109
109
 
110
110
  Failing Scenarios:
111
- cucumber features/outline_sample.feature:5 # Scenario: Test state
111
+ cucumber features/outline_sample.feature:5
112
112
 
113
113
  5 scenarios (1 failed, 1 undefined, 3 passed)
114
114
  8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)
@@ -17,7 +17,7 @@ Feature: Cucumber command line
17
17
  features/failing_expectation.feature:4:in `Given failing expectation'
18
18
 
19
19
  Failing Scenarios:
20
- cucumber features/failing_expectation.feature:3 # Scenario: Failing expectation
20
+ cucumber features/failing_expectation.feature:3
21
21
 
22
22
  1 scenario (1 failed)
23
23
  1 step (1 failed)
@@ -118,7 +118,7 @@ Feature: Profiles
118
118
  Then it should fail
119
119
  And the output should contain
120
120
  """
121
- cucumber -p super features/sample.feature:2 # Scenario: this is a test
121
+ cucumber -p super features/sample.feature:2
122
122
  """
123
123
  Examples:
124
124
  | format |
@@ -64,7 +64,7 @@ Feature: Cucumber --work-in-progress switch
64
64
  features/wip.feature:4:in `Given a failing step'
65
65
 
66
66
  Failing Scenarios:
67
- cucumber features/wip.feature:3 # Scenario: Failing
67
+ cucumber features/wip.feature:3
68
68
 
69
69
  1 scenario (1 failed)
70
70
  1 step (1 failed)
@@ -118,21 +118,23 @@ module Cucumber
118
118
  end
119
119
  end
120
120
 
121
+ # This constant is appended to by Cuke4Duke. Do not change its name
122
+ BACKTRACE_FILTER_PATTERNS = [/vendor\/rails|lib\/cucumber|bin\/cucumber:|lib\/rspec|gems\/|minitest|test\/unit/]
121
123
  PWD_PATTERN = /#{Regexp.escape(Dir.pwd)}\//m
122
- BACKTRACE_FILTER_PATTERN = /vendor\/rails|lib\/cucumber|bin\/cucumber:|lib\/rspec|gems\/|minitest|test\/unit/
123
- IN_PATTERN = /(.*):in `/
124
124
 
125
+ # This is to work around double ":in " segments in JRuby backtraces. JRuby bug?
125
126
  def filter_backtrace(e)
126
127
  return e if Cucumber.use_full_backtrace
127
128
  e.backtrace.each{|line| line.gsub!(PWD_PATTERN, "./")}
128
129
 
129
130
  filtered = (e.backtrace || []).reject do |line|
130
- line =~ BACKTRACE_FILTER_PATTERN
131
+ BACKTRACE_FILTER_PATTERNS.detect { |p| line =~ p }
131
132
  end
132
133
 
133
134
  if ENV['CUCUMBER_TRUNCATE_OUTPUT']
135
+ # Strip off file locations
134
136
  filtered = filtered.map do |line|
135
- line =~ IN_PATTERN ? $1 : line
137
+ line =~ /(.*):in `/ ? $1 : line
136
138
  end
137
139
  end
138
140
 
@@ -59,21 +59,16 @@ module Cucumber
59
59
  end
60
60
  end
61
61
 
62
- def print_counts
63
- STDERR.puts("The #print_counts method is deprecated and will be removed in 0.4. Use #print_stats instead")
64
- print_stats(nil)
65
- end
66
-
67
- def print_stats(features, profiles = [])
62
+ def print_stats(features, options)
68
63
  @failures = step_mother.scenarios(:failed).select { |s| s.is_a?(Cucumber::Ast::Scenario) || s.is_a?(Cucumber::Ast::OutlineTable::ExampleRow) }
69
64
  @failures.collect! { |s| (s.is_a?(Cucumber::Ast::OutlineTable::ExampleRow)) ? s.scenario_outline : s }
70
65
 
71
66
  if !@failures.empty?
72
67
  @io.puts format_string("Failing Scenarios:", :failed)
73
68
  @failures.each do |failure|
74
- profiles_string = profiles.empty? ? '' : (profiles.map{|profile| "-p #{profile}" }).join(' ') + ' '
75
- @io.puts format_string("cucumber #{profiles_string}" + failure.file_colon_line, :failed) +
76
- format_string(" # Scenario: " + failure.name, :comment)
69
+ profiles_string = options.custom_profiles.empty? ? '' : (options.custom_profiles.map{|profile| "-p #{profile}" }).join(' ') + ' '
70
+ source = options[:source] ? format_string(" # Scenario: " + failure.name, :comment) : ''
71
+ @io.puts format_string("cucumber #{profiles_string}" + failure.file_colon_line, :failed) + source
77
72
  end
78
73
  @io.puts
79
74
  end
@@ -87,9 +82,19 @@ module Cucumber
87
82
  end
88
83
 
89
84
  def print_exception(e, status, indent)
90
- string = "#{e.message} (#{e.class})\n#{e.backtrace.join("\n")}".indent(indent)
85
+ message = "#{e.message} (#{e.class})"
86
+ if ENV['CUCUMBER_TRUNCATE_OUTPUT']
87
+ message = linebreaks(message, ENV['CUCUMBER_TRUNCATE_OUTPUT'].to_i)
88
+ end
89
+
90
+ string = "#{message}\n#{e.backtrace.join("\n")}".indent(indent)
91
91
  @io.puts(format_string(string, status))
92
92
  end
93
+
94
+ # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10655
95
+ def linebreaks(s, max)
96
+ s.gsub(/.{1,#{max}}(?:\s|\Z)/){($& + 5.chr).gsub(/\n\005/,"\n").gsub(/\005/,"\n")}.rstrip
97
+ end
93
98
 
94
99
  def print_snippets(options)
95
100
  return unless options[:snippets]
@@ -228,7 +228,7 @@ module Cucumber
228
228
  end
229
229
 
230
230
  def print_summary(features)
231
- print_stats(features, @options.custom_profiles)
231
+ print_stats(features, @options)
232
232
  print_snippets(@options)
233
233
  print_passing_wip(@options)
234
234
  end
@@ -65,7 +65,7 @@ module Cucumber
65
65
  def print_summary(features)
66
66
  print_steps(:pending)
67
67
  print_steps(:failed)
68
- print_stats(features, @options.custom_profiles)
68
+ print_stats(features, @options)
69
69
  print_snippets(@options)
70
70
  print_passing_wip(@options)
71
71
  end
@@ -4,7 +4,7 @@ require 'rbconfig'
4
4
 
5
5
  module Cucumber
6
6
  unless defined?(Cucumber::VERSION)
7
- VERSION = '1.0.1'
7
+ VERSION = '1.0.2'
8
8
  BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber')
9
9
  LIBDIR = File.expand_path(File.dirname(__FILE__) + '/../../lib')
10
10
  JRUBY = defined?(JRUBY_VERSION)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Aslak Helles\xC3\xB8y"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-10 00:00:00 Z
13
+ date: 2011-07-17 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gherkin
@@ -831,7 +831,7 @@ licenses: []
831
831
 
832
832
  post_install_message: "\n\
833
833
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n\
834
- Thank you for installing cucumber-1.0.1.\n\
834
+ Thank you for installing cucumber-1.0.2.\n\
835
835
  Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading\n\
836
836
  for important information about this release. Happy cuking!\n\n\
837
837
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
@@ -857,7 +857,7 @@ rubyforge_project:
857
857
  rubygems_version: 1.8.5
858
858
  signing_key:
859
859
  specification_version: 3
860
- summary: cucumber-1.0.1
860
+ summary: cucumber-1.0.2
861
861
  test_files:
862
862
  - features/background.feature
863
863
  - features/bootstrap.feature