cucumber 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/History.txt +17 -0
  2. data/Manifest.txt +3 -2
  3. data/README.txt +3 -2
  4. data/config/hoe.rb +1 -0
  5. data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +1 -1
  6. data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/Rakefile +18 -2
  8. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +2 -1
  9. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +2 -1
  10. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -1
  11. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -1
  12. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +2 -1
  13. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +2 -1
  14. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +2 -1
  15. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -1
  16. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +2 -1
  17. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -1
  18. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -1
  19. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +2 -1
  20. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +2 -1
  21. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +2 -1
  22. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +2 -1
  23. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -1
  24. data/examples/java/features/step_definitons/hello_steps.rb +1 -1
  25. data/examples/java/features/step_definitons/tree_steps.rb +1 -1
  26. data/examples/selenium/features/step_definitons/stories_steps.rb +1 -1
  27. data/examples/tickets/features/scenario_outline.feature +26 -0
  28. data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +8 -0
  29. data/examples/tickets/features/step_definitons/tickets_steps.rb +1 -1
  30. data/examples/watir/README.textile +16 -0
  31. data/examples/watir/features/step_definitons/search_steps.rb +27 -0
  32. data/examples/watir/features/support/env.rb +32 -0
  33. data/gem_tasks/deployment.rake +0 -23
  34. data/gem_tasks/gemspec.rake +4 -0
  35. data/gem_tasks/rspec.rake +2 -2
  36. data/gem_tasks/treetop.rake +1 -1
  37. data/lib/autotest/cucumber_mixin.rb +1 -5
  38. data/lib/cucumber.rb +0 -21
  39. data/lib/cucumber/cli.rb +2 -1
  40. data/lib/cucumber/core_ext/string.rb +1 -1
  41. data/lib/cucumber/formatters/ansicolor.rb +8 -3
  42. data/lib/cucumber/formatters/pretty_formatter.rb +17 -8
  43. data/lib/cucumber/formatters/unicode.rb +5 -5
  44. data/lib/cucumber/platform.rb +28 -6
  45. data/lib/cucumber/rails/rspec.rb +1 -1
  46. data/lib/cucumber/rails/world.rb +1 -1
  47. data/lib/cucumber/rake/task.rb +3 -3
  48. data/lib/cucumber/treetop_parser/feature.treetop.erb +1 -0
  49. data/lib/cucumber/treetop_parser/feature_ar.rb +1 -0
  50. data/lib/cucumber/treetop_parser/feature_cy.rb +1 -0
  51. data/lib/cucumber/treetop_parser/feature_da.rb +1 -0
  52. data/lib/cucumber/treetop_parser/feature_de.rb +1 -0
  53. data/lib/cucumber/treetop_parser/feature_en-lol.rb +1 -0
  54. data/lib/cucumber/treetop_parser/feature_en-tx.rb +1 -0
  55. data/lib/cucumber/treetop_parser/feature_en.rb +1 -0
  56. data/lib/cucumber/treetop_parser/feature_es.rb +1 -0
  57. data/lib/cucumber/treetop_parser/feature_et.rb +1 -0
  58. data/lib/cucumber/treetop_parser/feature_fr.rb +1 -0
  59. data/lib/cucumber/treetop_parser/feature_id.rb +1 -0
  60. data/lib/cucumber/treetop_parser/feature_it.rb +1 -0
  61. data/lib/cucumber/treetop_parser/feature_ja.rb +1 -0
  62. data/lib/cucumber/treetop_parser/feature_lt.rb +1 -0
  63. data/lib/cucumber/treetop_parser/feature_nl.rb +1 -0
  64. data/lib/cucumber/treetop_parser/feature_no.rb +1 -0
  65. data/lib/cucumber/treetop_parser/feature_parser.rb +3 -1
  66. data/lib/cucumber/treetop_parser/feature_pl.rb +1 -0
  67. data/lib/cucumber/treetop_parser/feature_pt.rb +1 -0
  68. data/lib/cucumber/treetop_parser/feature_ro.rb +1 -0
  69. data/lib/cucumber/treetop_parser/feature_ro2.rb +1 -0
  70. data/lib/cucumber/treetop_parser/feature_ru.rb +1 -0
  71. data/lib/cucumber/treetop_parser/feature_se.rb +1 -0
  72. data/lib/cucumber/treetop_parser/feature_zh-CN.rb +1 -0
  73. data/lib/cucumber/version.rb +3 -2
  74. data/spec/cucumber/formatters/pretty_formatter_spec.rb +46 -2
  75. data/spec/cucumber/model/table_spec.rb +19 -5
  76. data/spec/cucumber/rails/stubs/mini_rails.rb +4 -3
  77. data/spec/cucumber/tree/step_outline_spec.rb +2 -2
  78. data/spec/spec_helper.rb +1 -1
  79. metadata +5 -4
  80. data/examples/java/src/cucumber/demo/Hello.java +0 -16
  81. data/examples/watir/features/step_definitons/stories_steps.rb +0 -51
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Cucumber
2
3
  # :stopdoc:
3
4
  module TreetopParser
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Cucumber
2
3
  # :stopdoc:
3
4
  module TreetopParser
@@ -2,8 +2,9 @@ module Cucumber #:nodoc:
2
2
  class VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 13
5
+ TINY = 14
6
+ PATCH = nil # 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={})
@@ -85,7 +86,14 @@ module Cucumber
85
86
  it "should display as pending in the dump" do
86
87
  @formatter.scenario_executing(@scenario)
87
88
  @formatter.dump
88
- @io.string.should include("1 scenarios pending")
89
+ @io.string.should include("1 scenario pending")
90
+ end
91
+
92
+ it "should display as pending in the dump (with two scenarios)" do
93
+ @formatter.scenario_executing(@scenario)
94
+ @formatter.scenario_executing(@scenario)
95
+ @formatter.dump
96
+ @io.string.should include("2 scenarios pending")
89
97
  end
90
98
  end
91
99
 
@@ -314,6 +322,42 @@ module Cucumber
314
322
  io.string.should include("1 with no step definition")
315
323
  end
316
324
 
325
+ it "should display the total number of scenarios executed (for 0 scenarios)" do
326
+ io = StringIO.new
327
+ formatter = PrettyFormatter.new io, mock('step_mother')
328
+
329
+ formatter.dump
330
+
331
+ io.string.should include("0 scenarios")
332
+ end
333
+
334
+ it "should display the total number of scenarios executed (for 1 scenario)" do
335
+ io = StringIO.new
336
+ formatter = PrettyFormatter.new io, mock('step_mother')
337
+
338
+ formatter.scenario_executing(mock_scenario)
339
+ formatter.scenario_executed(mock_scenario)
340
+
341
+ formatter.dump
342
+
343
+ io.string.should include("1 scenario")
344
+ end
345
+
346
+ it "should display the total number of scenarios executed (for 2 scenarios)" do
347
+ io = StringIO.new
348
+ formatter = PrettyFormatter.new io, mock('step_mother')
349
+
350
+ formatter.scenario_executing(mock_scenario)
351
+ formatter.scenario_executed(mock_scenario)
352
+
353
+ formatter.scenario_executing(mock_scenario)
354
+ formatter.scenario_executed(mock_scenario)
355
+
356
+ formatter.dump
357
+
358
+ io.string.should include("2 scenarios")
359
+ end
360
+
317
361
  describe "colour" do
318
362
 
319
363
  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,13 +5,14 @@ module ActiveRecord
5
5
  end
6
6
 
7
7
  module ActionController
8
+ class Dispatcher
9
+ end
10
+
8
11
  class Base
9
12
  end
13
+
10
14
  class IntegrationTest
11
15
  def self.use_transactional_fixtures=(x)
12
16
  end
13
17
  end
14
18
  end
15
-
16
- module Dispatcher
17
- 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
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
2
  gem 'rspec'
3
- require 'spec'
3
+ require 'spec/expectations'
4
4
 
5
5
  ENV['CUCUMBER_COLORS']=nil
6
6
  $KCODE='u'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
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 +01:00
12
+ date: 2009-01-04 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -164,7 +164,6 @@ files:
164
164
  - examples/java/features/step_definitons/hello_steps.rb
165
165
  - examples/java/features/step_definitons/tree_steps.rb
166
166
  - examples/java/features/tree.feature
167
- - examples/java/src/cucumber/demo/Hello.java
168
167
  - examples/selenium/Rakefile
169
168
  - examples/selenium/features/search.feature
170
169
  - examples/selenium/features/step_definitons/stories_steps.rb
@@ -179,9 +178,11 @@ files:
179
178
  - examples/tickets/features/step_definitons/scenario_outline_steps.rb
180
179
  - examples/tickets/features/step_definitons/tickets_steps.rb
181
180
  - examples/tickets/features/tickets.feature
181
+ - examples/watir/README.textile
182
182
  - examples/watir/Rakefile
183
183
  - examples/watir/features/search.feature
184
- - examples/watir/features/step_definitons/stories_steps.rb
184
+ - examples/watir/features/step_definitons/search_steps.rb
185
+ - examples/watir/features/support/env.rb
185
186
  - features/see_features.feature
186
187
  - features/steps/features_steps.rb
187
188
  - gem_tasks/deployment.rake
@@ -1,16 +0,0 @@
1
- package cucumber.demo;
2
-
3
- public class Hello {
4
- public String greet(String who, String from) {
5
- return "Hi, " + who + ". I'm " + from;
6
- }
7
-
8
- public boolean isFriend(String who) {
9
- return true;
10
- }
11
-
12
- public String getPhoneNumber(String who) {
13
- throw new RuntimeException("NOPE");
14
- //return "98219458";
15
- }
16
- }
@@ -1,51 +0,0 @@
1
- require 'spec'
2
-
3
- case PLATFORM
4
- when /darwin/
5
- require 'safariwatir'
6
- Browser = Watir::Safari
7
- when /win32|mingw/
8
- require 'watir'
9
- Browser = Watir::IE
10
- when /java/
11
- require 'celerity'
12
- Browser = Celerity::Browser
13
- else
14
- raise "This platform is not supported (#{PLATFORM})"
15
- end
16
-
17
- Before do
18
- @b = Browser.new
19
- end
20
-
21
- After do
22
- @b.close
23
- end
24
-
25
- class GoogleSearch
26
- def initialize(b)
27
- @b = b
28
- end
29
-
30
- def goto
31
- @b.goto 'http://www.google.com/'
32
- end
33
-
34
- def search(text)
35
- @b.text_field(:name, 'q').set(text)
36
- @b.button(:name, 'btnG').click
37
- end
38
- end
39
-
40
- Given 'I am on the Google search page' do
41
- @page = GoogleSearch.new(@b)
42
- @page.goto
43
- end
44
-
45
- When /I search for "(.*)"/ do |query|
46
- @page.search(query)
47
- end
48
-
49
- Then /I should see a link to "(.*)":(.*)/ do |text, url|
50
- @b.link(:url, url).text.should == text
51
- end