aslakhellesoy-cucumber 0.1.14.2 → 0.1.15

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
@@ -1,8 +1,15 @@
1
- == In Git
1
+ == 0.1.15 2009-01-08
2
+
3
+ Bugfix release
2
4
 
3
5
  === New features
4
6
  * 한국어! (Korean!) (John Hwang)
5
7
 
8
+ === Bugfixes
9
+ * Fix a minor bug in the console formatter's summary (David Chelimsky)
10
+ * Better quoting of Scenario names in Autotest (Peter Jaros)
11
+ * Added some small workarounds for unicode handling on Windows (Aslak Hellesøy)
12
+
6
13
  == 0.1.14 2009-01-04
7
14
 
8
15
  This is the first release of Cucumber that runs on Ruby 1.9. There are still some encoding-related issues
data/Manifest.txt CHANGED
@@ -104,6 +104,9 @@ examples/java/features/tree.feature
104
104
  examples/selenium/Rakefile
105
105
  examples/selenium/features/search.feature
106
106
  examples/selenium/features/step_definitons/stories_steps.rb
107
+ examples/self_test/README.textile
108
+ examples/self_test/features/sample.feature
109
+ examples/self_test/features/step_definitions/sample_steps.rb
107
110
  examples/test_unit/Rakefile
108
111
  examples/test_unit/features/step_definitions/test_unit_steps.rb
109
112
  examples/test_unit/features/test_unit.feature
@@ -120,8 +123,10 @@ examples/watir/Rakefile
120
123
  examples/watir/features/search.feature
121
124
  examples/watir/features/step_definitons/search_steps.rb
122
125
  examples/watir/features/support/env.rb
123
- features/see_features.feature
124
- features/steps/features_steps.rb
126
+ features/cucumber_cli.feature
127
+ features/step_definitions/cucumber_steps.rb
128
+ features/step_definitions/extra_steps.rb
129
+ features/support/env.rb
125
130
  gem_tasks/deployment.rake
126
131
  gem_tasks/environment.rake
127
132
  gem_tasks/features.rake
@@ -120,7 +120,10 @@ module Autotest::CucumberMixin
120
120
  if scenarios_to_run == :all
121
121
  scenario_args = nil
122
122
  else
123
- scenario_args = scenarios_to_run.map { |s| "-s '#{s}'" }.join(' ')
123
+ # We escape scenario names for the shell by wrapping them in $'...' and replacing
124
+ # every single quote with an escaped version, "\'". We use a double backslash for
125
+ # Ruby, and we put it in a block or gsub interpolates the sequence "\'" as $'.
126
+ scenario_args = scenarios_to_run.map { |s| "-s $'#{s.gsub("'") {"\\'"} }'" }.join(' ')
124
127
  end
125
128
  return "#{Cucumber::RUBY_BINARY} #{Cucumber::BINARY} #{args} #{scenario_args}"
126
129
  end
@@ -2,8 +2,8 @@ class Exception
2
2
  CUCUMBER_FILTER_PATTERNS = [
3
3
  /vendor\/rails/,
4
4
  /vendor\/plugins\/cucumber/,
5
- /spec\/expectations/,
6
- /spec\/matchers/
5
+ /vendor\/plugins\/rspec/,
6
+ /gems\/rspec/
7
7
  ]
8
8
 
9
9
  def self.cucumber_full_backtrace=(v)
@@ -183,8 +183,8 @@ module Cucumber
183
183
  @io.puts pending(dump_count(@pending_scenarios.length, "scenario", "pending")) if @pending_scenarios.any?
184
184
 
185
185
  @io.puts passed(dump_count(@passed.length, "step", "passed")) if @passed.any?
186
- @io.puts passed(dump_count(@failed.length, "step", "failed")) if @failed.any?
187
- @io.puts passed(dump_count(@skipped.length, "step", "skipped")) if @skipped.any?
186
+ @io.puts failed(dump_count(@failed.length, "step", "failed")) if @failed.any?
187
+ @io.puts skipped(dump_count(@skipped.length, "step", "skipped")) if @skipped.any?
188
188
 
189
189
  if @pending_steps.any?
190
190
  @io.print pending(dump_count(@pending_steps.length, "step", "pending"))
@@ -15,12 +15,20 @@ if Cucumber::WINDOWS_MRI && `chcp` =~ /Active code page: (\d+)/
15
15
  module Kernel
16
16
  alias cucumber_print print
17
17
  def print(*a)
18
- cucumber_print *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
18
+ begin
19
+ cucumber_print *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
20
+ rescue Iconv::IllegalSequence
21
+ cucumber_print(*a)
22
+ end
19
23
  end
20
24
 
21
25
  alias cucumber_puts puts
22
26
  def puts(*a)
23
- cucumber_puts *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
27
+ begin
28
+ cucumber_puts *Iconv.iconv(Cucumber::CODEPAGE, "UTF-8", *a)
29
+ rescue Iconv::IllegalSequence
30
+ cucumber_puts(*a)
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -64,7 +64,7 @@ module Cucumber
64
64
  @error = e
65
65
  # Remove lines underneath the plain text step
66
66
  e.backtrace[strip_pos..-1] = nil unless strip_pos.nil?
67
- e.backtrace.flatten
67
+ e.backtrace.compact!
68
68
  # Replace the step line with something more readable
69
69
  e.backtrace.replace(e.backtrace.map{|l| l.gsub(/`#{proc.meth}'/, "`#{keyword} #{proc.name}'")})
70
70
  if row?
@@ -2,8 +2,8 @@ module Cucumber #:nodoc:
2
2
  class VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 14
6
- PATCH = 2 # Set to nil for official release
5
+ TINY = 15
6
+ PATCH = nil # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -360,21 +360,48 @@ module Cucumber
360
360
 
361
361
  describe "colour" do
362
362
 
363
- before(:all) do
364
- Term::ANSIColor.coloring = true
363
+ before(:each) do
364
+ ::Term::ANSIColor.coloring = true
365
+ @io = StringIO.new
366
+ @formatter = PrettyFormatter.new @io, mock('step_mother')
365
367
  end
368
+
369
+ it "should show the scenario outline keyword and title as pending blue" do
370
+ @formatter.scenario_executing(mock_scenario(:outline? => true, :name => 'blue'))
366
371
 
367
- after(:all) do
368
- Term::ANSIColor.coloring = false
372
+ @io.string.should =~ /\e\[36m\s*Scenario Outline: blue\e\[0m/
369
373
  end
374
+
375
+ it "should show passing steps as green" do
376
+ @formatter.scenario_executing(mock_scenario)
377
+ @formatter.step_passed(mock_step, nil, nil)
378
+ @formatter.dump
370
379
 
371
- it "should show the scenario outline keyword and title as pending blue" do
372
- ::Term::ANSIColor.coloring = true
373
- io = StringIO.new
374
- formatter = PrettyFormatter.new io, mock('step_mother')
375
- formatter.scenario_executing(mock_scenario(:outline? => true, :name => 'blue'))
380
+ @io.string.should =~ /\e\[32m1 step passed\e/
381
+ end
382
+
383
+ it "should show pending steps as yellow" do
384
+ @formatter.scenario_executing(mock_scenario)
385
+ @formatter.step_pending(mock_step, nil, nil)
386
+ @formatter.dump
387
+
388
+ @io.string.should =~ /\e\[33m1 step pending\e/
389
+ end
390
+
391
+ it "should show failed steps as red" do
392
+ @formatter.scenario_executing(mock_scenario)
393
+ @formatter.step_failed(mock_step(:error => mock_error(:cucumber_backtrace => [])), nil, nil)
394
+ @formatter.dump
395
+
396
+ @io.string.should =~ /\e\[31m1 step failed\e/
397
+ end
398
+
399
+ it "should show skipped steps as cyan" do
400
+ @formatter.scenario_executing(mock_scenario)
401
+ @formatter.step_skipped(mock_step, nil, nil)
402
+ @formatter.dump
376
403
 
377
- io.string.should =~ /\e\[36m\s*Scenario Outline: blue\e\[0m/
404
+ @io.string.should =~ /\e\[36m1 step skipped\e/
378
405
  end
379
406
 
380
407
  end
@@ -20,10 +20,15 @@ module Cucumber
20
20
  end
21
21
 
22
22
  before(:each) do
23
+ ::Term::ANSIColor.coloring = false
23
24
  @io = StringIO.new
24
25
  step_mother = stub('step_mother')
25
26
  @formatter = ProfileFormatter.new(io, step_mother)
26
27
  end
28
+
29
+ after(:each) do
30
+ ::Term::ANSIColor.coloring = true
31
+ end
27
32
 
28
33
  it "should print a heading" do
29
34
  formatter.visit_features(nil)
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.14.2
4
+ version: 0.1.15
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-01-05 00:00:00 -08:00
12
+ date: 2009-01-08 00:00:00 -08:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -1,8 +0,0 @@
1
- Feature: See features
2
- In order to make Cucumber features more accessible
3
- I should be able to see the existing features in a system
4
-
5
- Scenario: See features as HTML
6
- Given the feature server is running
7
- When I visit "/features"
8
- Then I should see a link to "See features"
@@ -1,9 +0,0 @@
1
- Given /the feature server is running/ do
2
- raise "TODO"
3
- end
4
-
5
- When /I visit "(.*)"/ do |resource|
6
- end
7
-
8
- Then /I should see a link to "(.*)"/ do |text|
9
- end