aslakhellesoy-cucumber 0.1.13 → 0.1.13.2

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.
@@ -1,3 +1,13 @@
1
+ == In Git
2
+
3
+ === New features
4
+ * Pretty formatter shows number of scenarios (#139 Joseph Wilk)
5
+
6
+ === Bugfixes
7
+ * Fixed `load_missing_constant': uninitialized constant Dispatcher error with Rails (Aslak Hellesøy)
8
+
9
+ === Removed features
10
+
1
11
  == 0.1.13 2008-12-20
2
12
 
3
13
  It's time for some new features again. Output is now much better since you can use diffing, tweak
data/README.txt CHANGED
@@ -1,4 +1,5 @@
1
1
  = Cucumber
2
2
 
3
- Please see the "wiki":http://github.com/aslakhellesoy/cucumber/wikis/home
4
- for documentation.
3
+ Cast your ballot for the Cucumber logo! http://cukes.info/
4
+
5
+ Cucumber documentation is over at http://github.com/aslakhellesoy/cucumber/wikis/home
@@ -61,4 +61,30 @@ Feature: Outlines
61
61
  | 4 | strawberrys| 1 |
62
62
  | 2 | apricots | 5 |
63
63
 
64
+ Scenario Outline: placeholder in a multiline string
65
+ Given my shopping list
66
+ """
67
+ Must buy some <fruits>
68
+ """
69
+ Then my shopping list should equal
70
+ """
71
+ Must buy some cucumbers
72
+ """
73
+
74
+ Examples:
75
+ | fruits |
76
+ | cucumbers |
77
+
78
+ Scenario Outline: placeholder in step table
79
+ Given I have the following fruits in my pantry
80
+ | name | quantity |
81
+ | cucumbers | <quant_cukes> |
82
+ | strawberrys | <quant_straw> |
64
83
 
84
+ When I eat <number> <fruits> from the pantry
85
+ Then I should have <left> <fruits> in the pantry
86
+
87
+ Examples:
88
+ | quant_cukes | quant_straw | number | fruits | left |
89
+ | 10 | 5 | 2 | cucumbers | 8 |
90
+ | 5 | 5 | 4 | strawberrys | 1 |
@@ -12,6 +12,10 @@ Given "I have the following fruits in my pantry" do |pantry_table|
12
12
  end
13
13
  end
14
14
 
15
+ Given "my shopping list" do |list|
16
+ @shopping_list = list
17
+ end
18
+
15
19
  When /^I eat (\d+) (\w+)$/ do |count, fruit|
16
20
  @eattingMachine.eat(count)
17
21
  @eattingMachine.belly_count = count.to_i
@@ -32,3 +36,7 @@ end
32
36
  Then /^I should have (\d+) (\w+) in the pantry$/ do |count, fruit|
33
37
  @pantry.count(fruit).should == count.to_i
34
38
  end
39
+
40
+ Then /^my shopping list should equal$/ do |list|
41
+ @shopping_list.should == list
42
+ end
@@ -1,26 +1,3 @@
1
- desc 'Release the website and new gem version'
2
- task :deploy => [:check_version, :website, :release] do
3
- puts "Remember to create SVN tag:"
4
- puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
- "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
- puts "Suggested comment:"
7
- puts "Tagging release #{CHANGES}"
8
- end
9
-
10
- desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
- task :local_deploy => [:website_generate, :install_gem]
12
-
13
- task :check_version do
14
- unless ENV['VERSION']
15
- puts 'Must pass a VERSION=x.y.z release version'
16
- exit
17
- end
18
- unless ENV['VERSION'] == VERS
19
- puts "Please update your version.rb to match the release version, currently #{VERS}"
20
- exit
21
- end
22
- end
23
-
24
1
  desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
2
  task :install_gem_no_doc => [:clean, :package] do
26
3
  sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
@@ -2,5 +2,9 @@ namespace :gemspec do
2
2
  desc 'Refresh cucumber.gemspec to include ALL files'
3
3
  task :refresh => 'manifest:refresh' do
4
4
  File.open('cucumber.gemspec', 'w') {|io| io.write($hoe.spec.to_ruby)}
5
+ puts "1) git commit -a -m \"Release #{Cucumber::VERSION::STRING}\""
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"
5
9
  end
6
10
  end
@@ -19,6 +19,8 @@ module Cucumber
19
19
  @last_executed_was_row = false
20
20
  @pending_messages = {}
21
21
  @forced_pending_step_count = 0
22
+
23
+ @total_scenario_count = 0
22
24
  end
23
25
 
24
26
  def feature_executing(feature)
@@ -81,6 +83,7 @@ module Cucumber
81
83
  @io.puts
82
84
  output_failing_step(@failed.last)
83
85
  end
86
+ @total_scenario_count += 1
84
87
  end
85
88
 
86
89
  def step_passed(step, regexp, args)
@@ -100,14 +103,13 @@ module Cucumber
100
103
  end
101
104
 
102
105
  def step_failed(step, regexp, args)
106
+ @scenario_failed = true
103
107
  if step.row?
104
108
  args = step.visible_args if step.outline?
105
109
  @failed << step
106
- @scenario_failed = true
107
110
  print_failed_args(args)
108
111
  else
109
112
  @failed << step
110
- @scenario_failed = true
111
113
  @io.print failed(" #{step.keyword} #{step.format(regexp){|param| failed_param(param) << failed}}")
112
114
  if @options[:source]
113
115
  @io.print padding_spaces(step)
@@ -176,6 +178,8 @@ module Cucumber
176
178
 
177
179
  print_pending_messages if @pending_messages.any?
178
180
 
181
+ @io.puts "#{@total_scenario_count} scenarios"
182
+
179
183
  @io.puts pending("#{@pending_scenarios.length} scenarios pending") if @pending_scenarios.any?
180
184
 
181
185
  @io.puts passed("#{@passed.length} steps passed") if @passed.any?
@@ -199,7 +203,7 @@ module Cucumber
199
203
  end
200
204
  @io.puts
201
205
  end
202
-
206
+
203
207
  def print_snippets
204
208
  snippets = @pending_steps
205
209
  snippets.delete_if {|snippet| snippet.row? || @step_mother.has_step_definition?(snippet.name)}
@@ -15,7 +15,7 @@ ActionController::Base.class_eval do
15
15
  perform_action_without_rescue
16
16
  end
17
17
  end
18
- Dispatcher.class_eval do
18
+ ActionController::Dispatcher.class_eval do
19
19
  def self.failsafe_response(output, status, exception = nil)
20
20
  raise exception
21
21
  end
@@ -3,7 +3,8 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 13
6
+ PATCH = 3 # Set to nil for official release
6
7
 
7
- STRING = [MAJOR, MINOR, TINY].join('.')
8
+ STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
8
9
  end
9
10
  end
@@ -31,7 +31,8 @@ module Cucumber
31
31
  :file => 'file',
32
32
  :line => 1,
33
33
  :padding_length => 2,
34
- :outline? => false}.merge(stubs))
34
+ :outline? => false,
35
+ :table_header => nil}.merge(stubs))
35
36
  end
36
37
 
37
38
  def mock_scenario_outline(stubs={})
@@ -314,6 +315,18 @@ module Cucumber
314
315
  io.string.should include("1 with no step definition")
315
316
  end
316
317
 
318
+ it "should display the total number of scenarios executed" do
319
+ io = StringIO.new
320
+ formatter = PrettyFormatter.new io, mock('step_mother')
321
+
322
+ formatter.scenario_executing(mock_scenario)
323
+ formatter.scenario_executed(mock_scenario)
324
+
325
+ formatter.dump
326
+
327
+ io.string.should include("1 scenarios")
328
+ end
329
+
317
330
  describe "colour" do
318
331
 
319
332
  before(:all) do
@@ -3,18 +3,32 @@ require File.dirname(__FILE__) + '/../../spec_helper'
3
3
  module Cucumber
4
4
  module Model
5
5
  describe Table do
6
- it "should convert into hash-array" do
7
- raw = [
6
+ before do
7
+ @raw = [
8
8
  %w{name gender},
9
9
  %w{aslak male},
10
10
  %w{patty female},
11
- ]
12
- ha = Table.new(raw).hashes
11
+ ]
12
+ end
13
+
14
+ it "should convert into hash-array" do
15
+ ha = Table.new(@raw).hashes
13
16
  ha.should == [
14
17
  {'name' => 'aslak', 'gender' => 'male'},
15
18
  {'name' => 'patty', 'gender' => 'female'}
16
19
  ]
17
20
  end
21
+
22
+ it "should iterate over each row" do
23
+ rows = []
24
+ Table.new(@raw).raw[1..-1].each do |name, gender|
25
+ rows << [name, gender]
26
+ end
27
+ rows.should == [
28
+ %w{aslak male},
29
+ %w{patty female}
30
+ ]
31
+ end
18
32
  end
19
33
  end
20
- end
34
+ end
@@ -5,9 +5,9 @@ module Cucumber
5
5
  describe StepOutline do
6
6
 
7
7
  it "should be a outline" do
8
- step_outline = StepOutline.new(mock("scenario"), 'Given', 'outline', 1)
8
+ step_outline = StepOutline.new(mock("scenario"), 'Given', 'outline', 1)
9
9
 
10
- step_outline.should be_a_outline
10
+ step_outline.should be_a_outline
11
11
  end
12
12
 
13
13
  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.13
4
+ version: 0.1.13.2
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: 2008-12-20 00:00:00 -08:00
12
+ date: 2008-12-24 00:00:00 -08:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency