cucumber 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -0
- data/Manifest.txt +3 -2
- data/README.txt +3 -2
- data/config/hoe.rb +1 -0
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/Rakefile +18 -2
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +2 -1
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +2 -1
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +2 -1
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +2 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +2 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +2 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -1
- data/examples/java/features/step_definitons/hello_steps.rb +1 -1
- data/examples/java/features/step_definitons/tree_steps.rb +1 -1
- data/examples/selenium/features/step_definitons/stories_steps.rb +1 -1
- data/examples/tickets/features/scenario_outline.feature +26 -0
- data/examples/tickets/features/step_definitons/scenario_outline_steps.rb +8 -0
- data/examples/tickets/features/step_definitons/tickets_steps.rb +1 -1
- data/examples/watir/README.textile +16 -0
- data/examples/watir/features/step_definitons/search_steps.rb +27 -0
- data/examples/watir/features/support/env.rb +32 -0
- data/gem_tasks/deployment.rake +0 -23
- data/gem_tasks/gemspec.rake +4 -0
- data/gem_tasks/rspec.rake +2 -2
- data/gem_tasks/treetop.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +1 -5
- data/lib/cucumber.rb +0 -21
- data/lib/cucumber/cli.rb +2 -1
- data/lib/cucumber/core_ext/string.rb +1 -1
- data/lib/cucumber/formatters/ansicolor.rb +8 -3
- data/lib/cucumber/formatters/pretty_formatter.rb +17 -8
- data/lib/cucumber/formatters/unicode.rb +5 -5
- data/lib/cucumber/platform.rb +28 -6
- data/lib/cucumber/rails/rspec.rb +1 -1
- data/lib/cucumber/rails/world.rb +1 -1
- data/lib/cucumber/rake/task.rb +3 -3
- data/lib/cucumber/treetop_parser/feature.treetop.erb +1 -0
- data/lib/cucumber/treetop_parser/feature_ar.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_cy.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_da.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_de.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_en.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_es.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_et.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_fr.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_id.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_it.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ja.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_lt.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_nl.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_no.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_parser.rb +3 -1
- data/lib/cucumber/treetop_parser/feature_pl.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_pt.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ro.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ro2.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_ru.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_se.rb +1 -0
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +1 -0
- data/lib/cucumber/version.rb +3 -2
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +46 -2
- data/spec/cucumber/model/table_spec.rb +19 -5
- data/spec/cucumber/rails/stubs/mini_rails.rb +4 -3
- data/spec/cucumber/tree/step_outline_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +5 -4
- data/examples/java/src/cucumber/demo/Hello.java +0 -16
- data/examples/watir/features/step_definitons/stories_steps.rb +0 -51
data/lib/cucumber/version.rb
CHANGED
@@ -31,7 +31,8 @@ module Cucumber
|
|
31
31
|
:file => 'file',
|
32
32
|
:line => 1,
|
33
33
|
:padding_length => 2,
|
34
|
-
:outline? => false
|
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
|
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
|
-
|
7
|
-
raw = [
|
6
|
+
before do
|
7
|
+
@raw = [
|
8
8
|
%w{name gender},
|
9
9
|
%w{aslak male},
|
10
10
|
%w{patty female},
|
11
|
-
|
12
|
-
|
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
|
-
|
8
|
+
step_outline = StepOutline.new(mock("scenario"), 'Given', 'outline', 1)
|
9
9
|
|
10
|
-
|
10
|
+
step_outline.should be_a_outline
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
data/spec/spec_helper.rb
CHANGED
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.
|
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:
|
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/
|
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
|