aslakhellesoy-cucumber 0.1.16.4 → 0.1.16.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +75 -1
- data/Manifest.txt +58 -65
- data/examples/cs/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/Rakefile +3 -3
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -6
- data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/de/features/addition.feature +6 -6
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/en/features/addition.feature +6 -6
- data/examples/i18n/en/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
- data/examples/i18n/et/features/liitmine.feature +7 -6
- data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
- data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
- data/examples/i18n/fi/features/yhteenlasku.feature +2 -2
- data/examples/i18n/fr/features/addition.feature +2 -2
- data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
- data/examples/i18n/id/features/addition.feature +6 -6
- data/examples/i18n/id/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
- data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +2 -3
- data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/lt/features/addition.feature +7 -6
- data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +7 -7
- data/examples/i18n/no/features/summering.feature +1 -0
- data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
- data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +2 -2
- data/examples/jbehave/README.textile +17 -0
- data/examples/jbehave/features/support/env.rb +7 -0
- data/examples/jbehave/features/trading.feature +24 -0
- data/examples/jbehave/pom.xml +48 -0
- data/examples/self_test/README.textile +4 -1
- data/examples/self_test/features/call_undefined_step_from_step_def.feature +7 -0
- data/examples/self_test/features/lots_of_undefined.feature +8 -0
- data/examples/self_test/features/outline_sample.feature +8 -5
- data/examples/self_test/features/sample.feature +5 -3
- data/examples/self_test/features/step_definitions/sample_steps.rb +15 -3
- data/features/cucumber_cli.feature +199 -97
- data/features/cucumber_cli_outlines.feature +46 -38
- data/features/report_called_undefined_steps.feature +31 -0
- data/features/step_definitions/cucumber_steps.rb +7 -3
- data/features/step_definitions/extra_steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/gem_tasks/features.rake +1 -1
- data/gem_tasks/flog.rake +1 -1
- data/lib/autotest/cucumber_mixin.rb +16 -23
- data/lib/cucumber/ast/comment.rb +26 -0
- data/lib/cucumber/ast/examples.rb +22 -0
- data/lib/cucumber/ast/feature.rb +60 -0
- data/lib/cucumber/ast/features.rb +39 -0
- data/lib/cucumber/ast/filter.rb +22 -0
- data/lib/cucumber/ast/outline_table.rb +49 -0
- data/lib/cucumber/ast/py_string.rb +52 -0
- data/lib/cucumber/ast/scenario.rb +91 -0
- data/lib/cucumber/ast/scenario_outline.rb +83 -0
- data/lib/cucumber/ast/step.rb +130 -0
- data/lib/cucumber/ast/table.rb +214 -0
- data/lib/cucumber/ast/tags.rb +33 -0
- data/lib/cucumber/ast/visitor.rb +93 -0
- data/lib/cucumber/ast.rb +27 -0
- data/lib/cucumber/broadcaster.rb +1 -6
- data/lib/cucumber/cli.rb +178 -128
- data/lib/cucumber/core_ext/exception.rb +41 -8
- data/lib/cucumber/core_ext/instance_exec.rb +54 -0
- data/lib/cucumber/core_ext/proc.rb +29 -65
- data/lib/cucumber/core_ext/string.rb +19 -0
- data/lib/cucumber/{formatters → formatter}/ansicolor.rb +11 -10
- data/lib/cucumber/formatter/console.rb +116 -0
- data/lib/cucumber/formatter/pretty.rb +158 -0
- data/lib/cucumber/formatter/profile.rb +77 -0
- data/lib/cucumber/formatter/progress.rb +68 -0
- data/lib/cucumber/formatter.rb +1 -0
- data/lib/cucumber/formatters/autotest_formatter.rb +0 -2
- data/lib/cucumber/formatters/html_formatter.rb +4 -3
- data/lib/cucumber/formatters/pretty_formatter.rb +1 -1
- data/lib/cucumber/formatters/unicode.rb +3 -3
- data/lib/cucumber/jbehave.rb +104 -0
- data/lib/cucumber/languages.yml +100 -73
- data/lib/cucumber/parser/basic.rb +0 -0
- data/lib/cucumber/parser/feature.rb +1694 -0
- data/lib/cucumber/parser/feature.tt +206 -0
- data/lib/cucumber/parser/file_parser.rb +50 -0
- data/lib/cucumber/parser/i18n.tt +26 -0
- data/lib/cucumber/parser/treetop_ext.rb +9 -0
- data/lib/cucumber/parser.rb +27 -0
- data/lib/cucumber/platform.rb +3 -17
- data/lib/cucumber/step_definition.rb +83 -0
- data/lib/cucumber/step_mother.rb +128 -72
- data/lib/cucumber/version.rb +1 -1
- data/lib/cucumber.rb +56 -9
- data/spec/cucumber/ast/feature_factory.rb +54 -0
- data/spec/cucumber/ast/feature_spec.rb +60 -0
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +64 -0
- data/spec/cucumber/ast/scenario_spec.rb +82 -0
- data/spec/cucumber/ast/step_spec.rb +45 -0
- data/spec/cucumber/ast/table_spec.rb +81 -0
- data/spec/cucumber/broadcaster_spec.rb +4 -17
- data/spec/cucumber/cli_spec.rb +43 -148
- data/spec/cucumber/core_ext/proc_spec.rb +27 -35
- data/spec/cucumber/core_ext/string_spec.rb +8 -0
- data/spec/cucumber/{formatters → formatter}/ansicolor_spec.rb +2 -2
- data/spec/cucumber/formatter/html/cucumber.css +37 -0
- data/spec/cucumber/formatter/html/cucumber.js +11 -0
- data/spec/cucumber/formatter/html/index.html +45 -0
- data/spec/cucumber/formatter/html/jquery-1.3.min.js +19 -0
- data/spec/cucumber/formatter/html/jquery.uitableedit.js +100 -0
- data/spec/cucumber/formatters/autotest_formatter_spec.rb +1 -0
- data/spec/cucumber/formatters/profile_formatter_spec.rb +17 -16
- data/spec/cucumber/parser/feature_parser_spec.rb +247 -0
- data/spec/cucumber/parser/table_parser_spec.rb +48 -0
- data/spec/cucumber/step_definition_spec.rb +62 -0
- data/spec/cucumber/step_mom_spec.rb +49 -0
- data/spec/cucumber/treetop_parser/empty_feature.feature +1 -1
- data/spec/cucumber/treetop_parser/spaces.feature +3 -1
- data/spec/cucumber/treetop_parser/with_comments.feature +1 -1
- data/spec/cucumber/treetop_parser/with_tags.feature +18 -0
- data/spec/cucumber/world/pending_spec.rb +13 -12
- data/spec/spec_helper.rb +1 -1
- metadata +59 -67
- data/examples/calculator_ruby_features/Rakefile +0 -6
- data/examples/calculator_ruby_features/features/addition.rb +0 -39
- data/examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb +0 -43
- data/gem_tasks/treetop.rake +0 -41
- data/lib/cucumber/executor.rb +0 -205
- data/lib/cucumber/formatters/profile_formatter.rb +0 -92
- data/lib/cucumber/formatters/progress_formatter.rb +0 -61
- data/lib/cucumber/formatters.rb +0 -1
- data/lib/cucumber/model/table.rb +0 -32
- data/lib/cucumber/model.rb +0 -1
- data/lib/cucumber/step_methods.rb +0 -49
- data/lib/cucumber/tree/feature.rb +0 -105
- data/lib/cucumber/tree/features.rb +0 -21
- data/lib/cucumber/tree/given_scenario.rb +0 -13
- data/lib/cucumber/tree/scenario.rb +0 -240
- data/lib/cucumber/tree/step.rb +0 -173
- data/lib/cucumber/tree/table.rb +0 -26
- data/lib/cucumber/tree/top_down_visitor.rb +0 -23
- data/lib/cucumber/tree.rb +0 -16
- data/lib/cucumber/treetop_parser/feature.treetop.erb +0 -254
- data/lib/cucumber/treetop_parser/feature_ar.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_cy.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_da.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_de.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-lol.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en-tx.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_en.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_es.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_et.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_fr.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_id.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_it.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ja.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ko.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_lt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_nl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_no.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_parser.rb +0 -36
- data/lib/cucumber/treetop_parser/feature_pl.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_pt.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ro2.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_ru.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_se.rb +0 -1951
- data/lib/cucumber/treetop_parser/feature_zh-CN.rb +0 -1951
- data/lib/cucumber/world/pending.rb +0 -22
- data/lib/cucumber/world.rb +0 -1
- data/setup.rb +0 -1585
- data/spec/cucumber/executor_spec.rb +0 -382
- data/spec/cucumber/formatters/html_formatter_spec.rb +0 -104
- data/spec/cucumber/formatters/pretty_formatter_spec.rb +0 -410
- data/spec/cucumber/formatters/progress_formatter_spec.rb +0 -81
- data/spec/cucumber/model/table_spec.rb +0 -32
- data/spec/cucumber/step_mother_spec.rb +0 -74
- data/spec/cucumber/tree/feature_spec.rb +0 -122
- data/spec/cucumber/tree/row_scenario_outline_spec.rb +0 -73
- data/spec/cucumber/tree/row_scenario_spec.rb +0 -55
- data/spec/cucumber/tree/row_step_outline_spec.rb +0 -38
- data/spec/cucumber/tree/scenario_outline_spec.rb +0 -50
- data/spec/cucumber/tree/scenario_spec.rb +0 -134
- data/spec/cucumber/tree/step_outline_spec.rb +0 -17
- data/spec/cucumber/tree/step_spec.rb +0 -59
- data/spec/cucumber/treetop_parser/feature_parser_spec.rb +0 -120
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require 'treetop'
|
3
|
+
require 'cucumber/parser'
|
4
|
+
|
5
|
+
module Cucumber
|
6
|
+
module Parser
|
7
|
+
describe 'Tables' do
|
8
|
+
before do
|
9
|
+
@parser = FeatureParser.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def parse(text)
|
13
|
+
@parser.__send__(:prepare_to_parse, text)
|
14
|
+
@parser.root = :table
|
15
|
+
table = @parser._nt_table
|
16
|
+
table.raw
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should parse a 1x2 table with newline" do
|
20
|
+
parse(" | 1 | 2 | \n").should == [%w{1 2}]
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should parse a 1x2 table without newline" do
|
24
|
+
parse("| 1 | 2 |").should == [%w{1 2}]
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should parse a 1x2 table without spaces" do
|
28
|
+
parse("|1|2|").should == [%w{1 2}]
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should parse a 2x2 table" do
|
32
|
+
parse("| 1 | 2 |\n| 3 | 4 |\n").should == [%w{1 2}, %w{3 4}]
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should parse a 2x2 table with several newlines" do
|
36
|
+
parse("| 1 | 2 |\n| 3 | 4 |\n\n\n").should == [%w{1 2}, %w{3 4}]
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should parse a 2x2 table with empty cells" do
|
40
|
+
parse("| 1 | |\n|| 4 |\n").should == [['1', nil], [nil, '4']]
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should not parse a 2x2 table that isn't closed" do
|
44
|
+
parse("| 1 | |\n|| 4 ").should_not == [['1', nil], [nil, '4']]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
require 'cucumber/ast'
|
4
|
+
require 'cucumber/step_mother'
|
5
|
+
require 'cucumber/step_definition'
|
6
|
+
|
7
|
+
module Cucumber
|
8
|
+
describe StepDefinition do
|
9
|
+
before do
|
10
|
+
extend StepMother
|
11
|
+
@world = new_world
|
12
|
+
$inside = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should allow calling of other steps" do
|
16
|
+
Given /Outside/ do
|
17
|
+
Given "Inside"
|
18
|
+
end
|
19
|
+
Given /Inside/ do
|
20
|
+
$inside = true
|
21
|
+
end
|
22
|
+
|
23
|
+
step_definition("Outside").execute(nil, @world)
|
24
|
+
$inside.should == true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should allow calling of other steps with inline arg" do
|
28
|
+
Given /Outside/ do
|
29
|
+
Given "Inside", Ast::Table.new([['inside']])
|
30
|
+
end
|
31
|
+
Given /Inside/ do |table|
|
32
|
+
$inside = table.raw[0][0]
|
33
|
+
end
|
34
|
+
|
35
|
+
step_definition("Outside").execute(nil, @world)
|
36
|
+
$inside.should == 'inside'
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should raise Undefined when inside step is not defined" do
|
40
|
+
Given /Outside/ do
|
41
|
+
Given 'Inside'
|
42
|
+
end
|
43
|
+
|
44
|
+
step = mock('Step')
|
45
|
+
step.should_receive(:exception=)
|
46
|
+
lambda do
|
47
|
+
@world.__cucumber_current_step = step
|
48
|
+
step_definition('Outside').execute(nil, @world)
|
49
|
+
end.should raise_error(StepMother::Undefined, 'Undefined step: "Inside"')
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should allow forced pending" do
|
53
|
+
Given /Outside/ do
|
54
|
+
pending("Do me!")
|
55
|
+
end
|
56
|
+
|
57
|
+
lambda do
|
58
|
+
step_definition("Outside").execute(nil, @world)
|
59
|
+
end.should raise_error(StepMother::Pending, "Do me!")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
require 'cucumber/step_mother'
|
4
|
+
|
5
|
+
module Cucumber
|
6
|
+
describe StepMother do
|
7
|
+
before do
|
8
|
+
@step_mother = Object.new
|
9
|
+
@step_mother.extend(StepMother)
|
10
|
+
@visitor = mock('Visitor')
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should format step names" do
|
14
|
+
@step_mother.Given(/it (.*) in (.*)/) do |what, month|
|
15
|
+
end
|
16
|
+
@step_mother.Given(/nope something else/) do |what, month|
|
17
|
+
end
|
18
|
+
format = @step_mother.step_definition("it snows in april").format_args("it snows in april", "[%s]")
|
19
|
+
format.should == "it [snows] in [april]"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should raise Ambiguous error when multiple step definitions match" do
|
23
|
+
@step_mother.Given(/Three (.*) mice/) {|disability|}
|
24
|
+
@step_mother.Given(/Three blind (.*)/) {|animal|}
|
25
|
+
|
26
|
+
lambda do
|
27
|
+
@step_mother.step_definition("Three blind mice")
|
28
|
+
end.should raise_error(StepMother::Ambiguous, %{Ambiguous match of "Three blind mice":
|
29
|
+
|
30
|
+
spec/cucumber/step_mom_spec.rb:23:in `/Three (.*) mice/'
|
31
|
+
spec/cucumber/step_mom_spec.rb:24:in `/Three blind (.*)/'
|
32
|
+
|
33
|
+
})
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should raise Undefined error when no step definitions match" do
|
37
|
+
lambda do
|
38
|
+
@step_mother.step_definition("Three blind mice")
|
39
|
+
end.should raise_error(StepMother::Undefined)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should raise Redundant error when same regexp is registered twice" do
|
43
|
+
@step_mother.Given(/Three (.*) mice/) {|disability|}
|
44
|
+
lambda do
|
45
|
+
@step_mother.Given(/Three (.*) mice/) {|disability|}
|
46
|
+
end.should raise_error(StepMother::Redundant)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Uhm hai
|
2
|
+
# nai
|
3
|
+
@nice @hallo
|
4
|
+
Feature: With tags
|
5
|
+
|
6
|
+
@one @two
|
7
|
+
Scenario: Complete scenario
|
8
|
+
Given a valid API key
|
9
|
+
|
10
|
+
@three
|
11
|
+
Scenario: Will write at somepoint
|
12
|
+
|
13
|
+
@four @$$
|
14
|
+
Scenario: Another Complete scenario
|
15
|
+
Given an invalid API key
|
16
|
+
|
17
|
+
@six
|
18
|
+
Scenario Outline: Jalla
|
@@ -1,44 +1,45 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
2
|
|
3
3
|
module Cucumber
|
4
|
-
module
|
5
|
-
describe Pending do
|
4
|
+
module StepMother
|
5
|
+
describe 'Pending' do
|
6
6
|
|
7
7
|
before(:each) do
|
8
|
-
@
|
9
|
-
@
|
8
|
+
@step_mom = Object.new
|
9
|
+
@step_mom.extend(StepMother)
|
10
|
+
@world = @step_mom.new_world
|
10
11
|
end
|
11
12
|
|
12
|
-
it 'should raise a
|
13
|
+
it 'should raise a Pending if no block is supplied' do
|
13
14
|
lambda {
|
14
15
|
@world.pending "TODO"
|
15
|
-
}.should raise_error(
|
16
|
+
}.should raise_error(Pending, /TODO/)
|
16
17
|
end
|
17
18
|
|
18
|
-
it 'should raise a
|
19
|
+
it 'should raise a Pending if a supplied block fails as expected' do
|
19
20
|
lambda {
|
20
21
|
@world.pending "TODO" do
|
21
22
|
raise "oops"
|
22
23
|
end
|
23
|
-
}.should raise_error(
|
24
|
+
}.should raise_error(Pending, /TODO/)
|
24
25
|
end
|
25
26
|
|
26
|
-
it 'should raise a
|
27
|
+
it 'should raise a Pending if a supplied block fails as expected with a mock' do
|
27
28
|
lambda {
|
28
29
|
@world.pending "TODO" do
|
29
30
|
m = mock('thing')
|
30
31
|
m.should_receive(:foo)
|
31
32
|
m.rspec_verify
|
32
33
|
end
|
33
|
-
}.should raise_error(
|
34
|
+
}.should raise_error(Pending, /TODO/)
|
34
35
|
end
|
35
36
|
|
36
|
-
it 'should raise a
|
37
|
+
it 'should raise a Pending if a supplied block starts working' do
|
37
38
|
lambda {
|
38
39
|
@world.pending "TODO" do
|
39
40
|
# success!
|
40
41
|
end
|
41
|
-
}.should raise_error(
|
42
|
+
}.should raise_error(Pending, /TODO/)
|
42
43
|
end
|
43
44
|
|
44
45
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,8 +6,8 @@ ENV['CUCUMBER_COLORS']=nil
|
|
6
6
|
$KCODE='u'
|
7
7
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
8
8
|
require 'cucumber'
|
9
|
-
require 'cucumber/treetop_parser/feature_en'
|
10
9
|
Cucumber.load_language('en')
|
10
|
+
$:.unshift(File.dirname(__FILE__))
|
11
11
|
|
12
12
|
::Term::ANSIColor.coloring = true
|
13
13
|
|
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.16.
|
4
|
+
version: 0.1.16.5
|
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-
|
12
|
+
date: 2009-01-25 00:00:00 -08:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -71,9 +71,6 @@ files:
|
|
71
71
|
- config/hoe.rb
|
72
72
|
- config/requirements.rb
|
73
73
|
- cucumber.yml
|
74
|
-
- examples/calculator_ruby_features/Rakefile
|
75
|
-
- examples/calculator_ruby_features/features/addition.rb
|
76
|
-
- examples/calculator_ruby_features/features/step_definitons/calculator_steps.rb
|
77
74
|
- examples/cs/README.textile
|
78
75
|
- examples/cs/Rakefile
|
79
76
|
- examples/cs/compile.bat
|
@@ -170,10 +167,17 @@ files:
|
|
170
167
|
- examples/java/features/step_definitons/hello_steps.rb
|
171
168
|
- examples/java/features/step_definitons/tree_steps.rb
|
172
169
|
- examples/java/features/tree.feature
|
170
|
+
- examples/jbehave/README.textile
|
171
|
+
- examples/jbehave/features/support/env.rb
|
172
|
+
- examples/jbehave/features/trading.feature
|
173
|
+
- examples/jbehave/pom.xml
|
174
|
+
- examples/jbehave/target/maven-archiver/pom.properties
|
173
175
|
- examples/selenium/Rakefile
|
174
176
|
- examples/selenium/features/search.feature
|
175
177
|
- examples/selenium/features/step_definitons/stories_steps.rb
|
176
178
|
- examples/self_test/README.textile
|
179
|
+
- examples/self_test/features/call_undefined_step_from_step_def.feature
|
180
|
+
- examples/self_test/features/lots_of_undefined.feature
|
177
181
|
- examples/self_test/features/outline_sample.feature
|
178
182
|
- examples/self_test/features/sample.feature
|
179
183
|
- examples/self_test/features/step_definitions/sample_steps.rb
|
@@ -195,6 +199,7 @@ files:
|
|
195
199
|
- examples/watir/features/support/env.rb
|
196
200
|
- features/cucumber_cli.feature
|
197
201
|
- features/cucumber_cli_outlines.feature
|
202
|
+
- features/report_called_undefined_steps.feature
|
198
203
|
- features/step_definitions/cucumber_steps.rb
|
199
204
|
- features/step_definitions/extra_steps.rb
|
200
205
|
- features/support/env.rb
|
@@ -205,7 +210,6 @@ files:
|
|
205
210
|
- gem_tasks/flog.rake
|
206
211
|
- gem_tasks/gemspec.rake
|
207
212
|
- gem_tasks/rspec.rake
|
208
|
-
- gem_tasks/treetop.rake
|
209
213
|
- gem_tasks/yard.rake
|
210
214
|
- lib/autotest/cucumber.rb
|
211
215
|
- lib/autotest/cucumber_mixin.rb
|
@@ -214,70 +218,56 @@ files:
|
|
214
218
|
- lib/autotest/cucumber_rspec.rb
|
215
219
|
- lib/autotest/discover.rb
|
216
220
|
- lib/cucumber.rb
|
221
|
+
- lib/cucumber/ast.rb
|
222
|
+
- lib/cucumber/ast/comment.rb
|
223
|
+
- lib/cucumber/ast/examples.rb
|
224
|
+
- lib/cucumber/ast/feature.rb
|
225
|
+
- lib/cucumber/ast/features.rb
|
226
|
+
- lib/cucumber/ast/filter.rb
|
227
|
+
- lib/cucumber/ast/outline_table.rb
|
228
|
+
- lib/cucumber/ast/py_string.rb
|
229
|
+
- lib/cucumber/ast/scenario.rb
|
230
|
+
- lib/cucumber/ast/scenario_outline.rb
|
231
|
+
- lib/cucumber/ast/step.rb
|
232
|
+
- lib/cucumber/ast/table.rb
|
233
|
+
- lib/cucumber/ast/tags.rb
|
234
|
+
- lib/cucumber/ast/visitor.rb
|
217
235
|
- lib/cucumber/broadcaster.rb
|
218
236
|
- lib/cucumber/cli.rb
|
219
237
|
- lib/cucumber/core_ext/exception.rb
|
238
|
+
- lib/cucumber/core_ext/instance_exec.rb
|
220
239
|
- lib/cucumber/core_ext/proc.rb
|
221
240
|
- lib/cucumber/core_ext/string.rb
|
222
|
-
- lib/cucumber/
|
223
|
-
- lib/cucumber/
|
224
|
-
- lib/cucumber/
|
241
|
+
- lib/cucumber/formatter.rb
|
242
|
+
- lib/cucumber/formatter/ansicolor.rb
|
243
|
+
- lib/cucumber/formatter/console.rb
|
244
|
+
- lib/cucumber/formatter/pretty.rb
|
245
|
+
- lib/cucumber/formatter/profile.rb
|
246
|
+
- lib/cucumber/formatter/progress.rb
|
225
247
|
- lib/cucumber/formatters/autotest_formatter.rb
|
226
248
|
- lib/cucumber/formatters/cucumber.css
|
227
249
|
- lib/cucumber/formatters/cucumber.js
|
228
250
|
- lib/cucumber/formatters/html_formatter.rb
|
229
251
|
- lib/cucumber/formatters/jquery.js
|
230
252
|
- lib/cucumber/formatters/pretty_formatter.rb
|
231
|
-
- lib/cucumber/formatters/profile_formatter.rb
|
232
|
-
- lib/cucumber/formatters/progress_formatter.rb
|
233
253
|
- lib/cucumber/formatters/unicode.rb
|
254
|
+
- lib/cucumber/jbehave.rb
|
234
255
|
- lib/cucumber/languages.yml
|
235
|
-
- lib/cucumber/
|
236
|
-
- lib/cucumber/
|
256
|
+
- lib/cucumber/parser.rb
|
257
|
+
- lib/cucumber/parser/basic.rb
|
258
|
+
- lib/cucumber/parser/feature.rb
|
259
|
+
- lib/cucumber/parser/feature.tt
|
260
|
+
- lib/cucumber/parser/file_parser.rb
|
261
|
+
- lib/cucumber/parser/i18n.tt
|
262
|
+
- lib/cucumber/parser/treetop_ext.rb
|
237
263
|
- lib/cucumber/platform.rb
|
238
264
|
- lib/cucumber/rails/rspec.rb
|
239
265
|
- lib/cucumber/rails/world.rb
|
240
266
|
- lib/cucumber/rake/task.rb
|
241
|
-
- lib/cucumber/
|
267
|
+
- lib/cucumber/step_definition.rb
|
242
268
|
- lib/cucumber/step_mother.rb
|
243
|
-
- lib/cucumber/tree.rb
|
244
|
-
- lib/cucumber/tree/feature.rb
|
245
|
-
- lib/cucumber/tree/features.rb
|
246
|
-
- lib/cucumber/tree/given_scenario.rb
|
247
|
-
- lib/cucumber/tree/scenario.rb
|
248
|
-
- lib/cucumber/tree/step.rb
|
249
|
-
- lib/cucumber/tree/table.rb
|
250
|
-
- lib/cucumber/tree/top_down_visitor.rb
|
251
|
-
- lib/cucumber/treetop_parser/feature.treetop.erb
|
252
|
-
- lib/cucumber/treetop_parser/feature_ar.rb
|
253
|
-
- lib/cucumber/treetop_parser/feature_cy.rb
|
254
|
-
- lib/cucumber/treetop_parser/feature_da.rb
|
255
|
-
- lib/cucumber/treetop_parser/feature_de.rb
|
256
|
-
- lib/cucumber/treetop_parser/feature_en-lol.rb
|
257
|
-
- lib/cucumber/treetop_parser/feature_en-tx.rb
|
258
|
-
- lib/cucumber/treetop_parser/feature_en.rb
|
259
|
-
- lib/cucumber/treetop_parser/feature_es.rb
|
260
|
-
- lib/cucumber/treetop_parser/feature_et.rb
|
261
269
|
- lib/cucumber/treetop_parser/feature_fi.rb
|
262
|
-
- lib/cucumber/treetop_parser/feature_fr.rb
|
263
|
-
- lib/cucumber/treetop_parser/feature_id.rb
|
264
|
-
- lib/cucumber/treetop_parser/feature_it.rb
|
265
|
-
- lib/cucumber/treetop_parser/feature_ja.rb
|
266
|
-
- lib/cucumber/treetop_parser/feature_ko.rb
|
267
|
-
- lib/cucumber/treetop_parser/feature_lt.rb
|
268
|
-
- lib/cucumber/treetop_parser/feature_nl.rb
|
269
|
-
- lib/cucumber/treetop_parser/feature_no.rb
|
270
|
-
- lib/cucumber/treetop_parser/feature_parser.rb
|
271
|
-
- lib/cucumber/treetop_parser/feature_pl.rb
|
272
|
-
- lib/cucumber/treetop_parser/feature_pt.rb
|
273
|
-
- lib/cucumber/treetop_parser/feature_ro.rb
|
274
|
-
- lib/cucumber/treetop_parser/feature_ro2.rb
|
275
|
-
- lib/cucumber/treetop_parser/feature_ru.rb
|
276
|
-
- lib/cucumber/treetop_parser/feature_se.rb
|
277
|
-
- lib/cucumber/treetop_parser/feature_zh-CN.rb
|
278
270
|
- lib/cucumber/version.rb
|
279
|
-
- lib/cucumber/world.rb
|
280
|
-
- lib/cucumber/world/pending.rb
|
281
271
|
- rails_generators/cucumber/USAGE
|
282
272
|
- rails_generators/cucumber/cucumber_generator.rb
|
283
273
|
- rails_generators/cucumber/templates/cucumber
|
@@ -289,37 +279,38 @@ files:
|
|
289
279
|
- rails_generators/feature/feature_generator.rb
|
290
280
|
- rails_generators/feature/templates/feature.erb
|
291
281
|
- rails_generators/feature/templates/steps.erb
|
292
|
-
-
|
282
|
+
- spec/cucumber/ast/feature_factory.rb
|
283
|
+
- spec/cucumber/ast/feature_spec.rb
|
284
|
+
- spec/cucumber/ast/py_string_spec.rb
|
285
|
+
- spec/cucumber/ast/scenario_outline_spec.rb
|
286
|
+
- spec/cucumber/ast/scenario_spec.rb
|
287
|
+
- spec/cucumber/ast/step_spec.rb
|
288
|
+
- spec/cucumber/ast/table_spec.rb
|
293
289
|
- spec/cucumber/broadcaster_spec.rb
|
294
290
|
- spec/cucumber/cli_spec.rb
|
295
291
|
- spec/cucumber/core_ext/proc_spec.rb
|
296
292
|
- spec/cucumber/core_ext/string_spec.rb
|
297
|
-
- spec/cucumber/
|
298
|
-
- spec/cucumber/
|
293
|
+
- spec/cucumber/formatter/ansicolor_spec.rb
|
294
|
+
- spec/cucumber/formatter/html/cucumber.css
|
295
|
+
- spec/cucumber/formatter/html/cucumber.js
|
296
|
+
- spec/cucumber/formatter/html/index.html
|
297
|
+
- spec/cucumber/formatter/html/jquery-1.3.min.js
|
298
|
+
- spec/cucumber/formatter/html/jquery.uitableedit.js
|
299
|
+
- spec/cucumber/formatter/pretty_spec.rb
|
299
300
|
- spec/cucumber/formatters/autotest_formatter_spec.rb
|
300
301
|
- spec/cucumber/formatters/features.html
|
301
|
-
- spec/cucumber/formatters/html_formatter_spec.rb
|
302
|
-
- spec/cucumber/formatters/pretty_formatter_spec.rb
|
303
302
|
- spec/cucumber/formatters/profile_formatter_spec.rb
|
304
|
-
- spec/cucumber/
|
305
|
-
- spec/cucumber/
|
303
|
+
- spec/cucumber/parser/feature_parser_spec.rb
|
304
|
+
- spec/cucumber/parser/table_parser_spec.rb
|
306
305
|
- spec/cucumber/rails/stubs/mini_rails.rb
|
307
306
|
- spec/cucumber/rails/stubs/test_help.rb
|
308
307
|
- spec/cucumber/rails/world_spec.rb
|
309
308
|
- spec/cucumber/sell_cucumbers.feature
|
310
|
-
- spec/cucumber/
|
311
|
-
- spec/cucumber/
|
312
|
-
- spec/cucumber/tree/row_scenario_outline_spec.rb
|
313
|
-
- spec/cucumber/tree/row_scenario_spec.rb
|
314
|
-
- spec/cucumber/tree/row_step_outline_spec.rb
|
315
|
-
- spec/cucumber/tree/scenario_outline_spec.rb
|
316
|
-
- spec/cucumber/tree/scenario_spec.rb
|
317
|
-
- spec/cucumber/tree/step_outline_spec.rb
|
318
|
-
- spec/cucumber/tree/step_spec.rb
|
309
|
+
- spec/cucumber/step_definition_spec.rb
|
310
|
+
- spec/cucumber/step_mom_spec.rb
|
319
311
|
- spec/cucumber/treetop_parser/empty_feature.feature
|
320
312
|
- spec/cucumber/treetop_parser/empty_scenario.feature
|
321
313
|
- spec/cucumber/treetop_parser/empty_scenario_outline.feature
|
322
|
-
- spec/cucumber/treetop_parser/feature_parser_spec.rb
|
323
314
|
- spec/cucumber/treetop_parser/fit_scenario.feature
|
324
315
|
- spec/cucumber/treetop_parser/given_scenario.feature
|
325
316
|
- spec/cucumber/treetop_parser/invalid_scenario_outlines.feature
|
@@ -329,6 +320,7 @@ files:
|
|
329
320
|
- spec/cucumber/treetop_parser/spaces.feature
|
330
321
|
- spec/cucumber/treetop_parser/test_dos.feature
|
331
322
|
- spec/cucumber/treetop_parser/with_comments.feature
|
323
|
+
- spec/cucumber/treetop_parser/with_tags.feature
|
332
324
|
- spec/cucumber/world/pending_spec.rb
|
333
325
|
- spec/spec.opts
|
334
326
|
- spec/spec_helper.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'cucumber/cli' # Needed in order to run the feature with ruby
|
2
|
-
|
3
|
-
Feature %|Addition
|
4
|
-
In order to avoid silly mistakes
|
5
|
-
As a math idiot
|
6
|
-
I want to be told the sum of two numbers| do
|
7
|
-
|
8
|
-
Scenario "Add two numbers" do
|
9
|
-
Given "I have entered 50 into the calculator"
|
10
|
-
And "I have entered 70 into the calculator"
|
11
|
-
When "I add"
|
12
|
-
Then "the result should be 120 on the screen"
|
13
|
-
And "the result class should be Fixnum"
|
14
|
-
end
|
15
|
-
|
16
|
-
Table do |t|
|
17
|
-
t | "input_1" | "input_2" | "output" | "class" | t
|
18
|
-
# This is kind of dumb - but it illustrates how scenarios can be "generated" in code.
|
19
|
-
10.times do |n|
|
20
|
-
t | n | n*2 | n*3 | Fixnum | t
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
ScenarioOutline "Add two numbers" do
|
25
|
-
Given "I have entered <input_1> into the calculator"
|
26
|
-
And "I have entered <input_2> into the calculator"
|
27
|
-
When "I add"
|
28
|
-
Then "the result should be <output> on the screen"
|
29
|
-
And "the result class should be <class>"
|
30
|
-
end
|
31
|
-
|
32
|
-
Table do |t|
|
33
|
-
t | "input_1" | "input_2" | "output" | "class" | t
|
34
|
-
10.times do |n|
|
35
|
-
t | n | n*2 | n*3 | Fixnum | t
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'spec/expectations'
|
2
|
-
|
3
|
-
class Calculator
|
4
|
-
def push(n)
|
5
|
-
@args ||= []
|
6
|
-
@args << n
|
7
|
-
end
|
8
|
-
|
9
|
-
def add
|
10
|
-
@args.inject(0){|n,sum| sum+=n}
|
11
|
-
end
|
12
|
-
|
13
|
-
def divide
|
14
|
-
@args[0].to_f / @args[1].to_f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
Before do
|
19
|
-
@calc = Calculator.new
|
20
|
-
end
|
21
|
-
|
22
|
-
After do
|
23
|
-
end
|
24
|
-
|
25
|
-
Given /I have entered (\d+) into the calculator/ do |n|
|
26
|
-
@calc.push n.to_i
|
27
|
-
end
|
28
|
-
|
29
|
-
When 'I add' do
|
30
|
-
@result = @calc.add
|
31
|
-
end
|
32
|
-
|
33
|
-
When 'I divide' do
|
34
|
-
@result = @calc.divide
|
35
|
-
end
|
36
|
-
|
37
|
-
Then /the result should be (\d*) on the screen/ do |result|
|
38
|
-
@result.should == result.to_i
|
39
|
-
end
|
40
|
-
|
41
|
-
Then /the result class should be (\w*)/ do |class_name|
|
42
|
-
@result.class.name.should == class_name
|
43
|
-
end
|
data/gem_tasks/treetop.rake
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
class FeatureCompiler
|
2
|
-
def initialize
|
3
|
-
require 'yaml'
|
4
|
-
require 'erb'
|
5
|
-
|
6
|
-
@tt = RUBY_PLATFORM =~ /mswin|mingw/ ? 'tt.bat' : 'tt'
|
7
|
-
|
8
|
-
@template = ERB.new(IO.read(File.dirname(__FILE__) + '/../lib/cucumber/treetop_parser/feature.treetop.erb'))
|
9
|
-
@langs = YAML.load_file(File.dirname(__FILE__) + '/../lib/cucumber/languages.yml')
|
10
|
-
end
|
11
|
-
|
12
|
-
def compile_all
|
13
|
-
@langs.keys.each do |lang|
|
14
|
-
compile(lang)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def compile(lang)
|
19
|
-
words = @langs['en'].merge(@langs[lang]) # Use English words if languages.yml is missing a word
|
20
|
-
grammar_file = File.dirname(__FILE__) + "/../lib/cucumber/treetop_parser/feature_#{lang}.treetop"
|
21
|
-
ruby_file = File.dirname(__FILE__) + "/../lib/cucumber/treetop_parser/feature_#{lang}.rb"
|
22
|
-
grammar = @template.result(binding)
|
23
|
-
File.open(grammar_file, "wb") do |io|
|
24
|
-
io.write(grammar)
|
25
|
-
end
|
26
|
-
sh "#{@tt} #{grammar_file}"
|
27
|
-
FileUtils.rm(grammar_file)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
namespace :treetop do
|
32
|
-
desc 'Compile the grammar for all languages in languages.yml'
|
33
|
-
task :compile do
|
34
|
-
FeatureCompiler.new.compile_all
|
35
|
-
end
|
36
|
-
|
37
|
-
desc 'Compile the English grammar'
|
38
|
-
task :compile_en do
|
39
|
-
FeatureCompiler.new.compile('en')
|
40
|
-
end
|
41
|
-
end
|