cucumber 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +19 -0
- data/README.rdoc +1 -1
- data/Rakefile +2 -5
- data/VERSION.yml +1 -1
- data/cucumber.gemspec +12 -4
- data/examples/i18n/de/features/addition.feature +1 -1
- data/examples/i18n/de/features/step_definitons/calculator_steps.rb +3 -3
- data/examples/self_test/features/step_definitions/sample_steps.rb +22 -22
- data/examples/tickets/features/half_manual.feature +11 -0
- data/examples/tickets/features/step_definitons/half_manual_steps.rb +11 -0
- data/features/announce.feature +97 -97
- data/features/background.feature +1 -4
- data/features/bug_475.feature +1 -2
- data/features/call_many_steps.feature +4 -6
- data/features/exception_in_after_block.feature +2 -3
- data/features/exception_in_after_step_block.feature +2 -3
- data/features/exception_in_before_block.feature +1 -2
- data/features/html_formatter/a.html +50 -40
- data/features/negative_tagged_hooks.feature +2 -3
- data/features/profiles.feature +2 -2
- data/features/report_called_undefined_steps.feature +2 -2
- data/features/rerun_formatter.feature +45 -0
- data/features/table_diffing.feature +1 -1
- data/features/table_mapping.feature +2 -3
- data/features/wire_protocol_table_diffing.feature +25 -0
- data/features/wire_protocol_tags.feature +47 -0
- data/lib/cucumber/ast/table.rb +2 -2
- data/lib/cucumber/cli/configuration.rb +1 -1
- data/lib/cucumber/cli/drb_client.rb +27 -16
- data/lib/cucumber/cli/profile_loader.rb +3 -2
- data/lib/cucumber/core_ext/proc.rb +1 -2
- data/lib/cucumber/formatter/console.rb +6 -4
- data/lib/cucumber/formatter/cucumber.css +10 -0
- data/lib/cucumber/formatter/cucumber.sass +10 -0
- data/lib/cucumber/formatter/html.rb +197 -186
- data/lib/cucumber/formatter/pdf.rb +24 -7
- data/lib/cucumber/formatter/rerun.rb +6 -3
- data/lib/cucumber/formatter/unicode.rb +1 -1
- data/lib/cucumber/languages.yml +7 -7
- data/lib/cucumber/parser/natural_language.rb +7 -0
- data/lib/cucumber/parser/treetop_ext.rb +1 -0
- data/lib/cucumber/rb_support/rb_world.rb +5 -0
- data/lib/cucumber/step_match.rb +4 -2
- data/lib/cucumber/step_mother.rb +53 -4
- data/lib/cucumber/wire_support/configuration.rb +11 -1
- data/lib/cucumber/wire_support/wire_language.rb +6 -3
- data/lib/cucumber/wire_support/wire_protocol.rb +2 -2
- data/lib/cucumber/wire_support/wire_protocol/requests.rb +26 -4
- data/spec/cucumber/ast/background_spec.rb +3 -3
- data/spec/cucumber/ast/feature_element_spec.rb +2 -2
- data/spec/cucumber/ast/feature_spec.rb +5 -5
- data/spec/cucumber/ast/outline_table_spec.rb +1 -1
- data/spec/cucumber/ast/py_string_spec.rb +1 -1
- data/spec/cucumber/ast/scenario_outline_spec.rb +3 -3
- data/spec/cucumber/ast/scenario_spec.rb +3 -3
- data/spec/cucumber/ast/step_collection_spec.rb +3 -3
- data/spec/cucumber/ast/step_spec.rb +1 -1
- data/spec/cucumber/ast/table_spec.rb +23 -3
- data/spec/cucumber/ast/tree_walker_spec.rb +1 -1
- data/spec/cucumber/broadcaster_spec.rb +1 -1
- data/spec/cucumber/cli/configuration_spec.rb +16 -6
- data/spec/cucumber/cli/drb_client_spec.rb +1 -1
- data/spec/cucumber/cli/main_spec.rb +13 -14
- data/spec/cucumber/cli/options_spec.rb +1 -1
- data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
- data/spec/cucumber/core_ext/proc_spec.rb +1 -1
- data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
- data/spec/cucumber/formatter/color_io_spec.rb +1 -1
- data/spec/cucumber/formatter/duration_spec.rb +1 -1
- data/spec/cucumber/formatter/html_spec.rb +2 -2
- data/spec/cucumber/formatter/junit_spec.rb +2 -2
- data/spec/cucumber/formatter/progress_spec.rb +3 -3
- data/spec/cucumber/parser/feature_parser_spec.rb +5 -5
- data/spec/cucumber/parser/table_parser_spec.rb +3 -3
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +7 -7
- data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
- data/spec/cucumber/step_match_spec.rb +6 -1
- data/spec/cucumber/step_mother_spec.rb +18 -10
- data/spec/cucumber/tag_expression_spec.rb +88 -90
- data/spec/cucumber/wire_support/configuration_spec.rb +29 -12
- data/spec/cucumber/wire_support/connection_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
- data/spec/cucumber/world/pending_spec.rb +5 -5
- metadata +128 -54
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'cucumber/ast/feature_factory'
|
3
3
|
|
4
4
|
module Cucumber
|
@@ -7,11 +7,11 @@ module Cucumber
|
|
7
7
|
include FeatureFactory
|
8
8
|
|
9
9
|
it "should convert to sexp" do
|
10
|
-
step_mother = StepMother.new
|
10
|
+
step_mother = Cucumber::StepMother.new
|
11
11
|
step_mother.load_natural_language('en')
|
12
12
|
step_mother.load_programming_language('rb')
|
13
13
|
dsl = Object.new
|
14
|
-
dsl.extend RbSupport::RbDsl
|
14
|
+
dsl.extend Cucumber::RbSupport::RbDsl
|
15
15
|
|
16
16
|
feature = create_feature(dsl)
|
17
17
|
if Cucumber::WINDOWS
|
@@ -46,11 +46,11 @@ module Cucumber
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should store OS specific file paths" do
|
49
|
-
step_mother = StepMother.new
|
49
|
+
step_mother = Cucumber::StepMother.new
|
50
50
|
step_mother.load_natural_language('en')
|
51
51
|
step_mother.load_programming_language('rb')
|
52
52
|
dsl = Object.new
|
53
|
-
dsl.extend RbSupport::RbDsl
|
53
|
+
dsl.extend Cucumber::RbSupport::RbDsl
|
54
54
|
feature = create_feature(dsl)
|
55
55
|
|
56
56
|
if Cucumber::WINDOWS
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'cucumber/step_mother'
|
3
3
|
require 'cucumber/ast'
|
4
4
|
require 'cucumber/core_ext/string'
|
@@ -8,11 +8,11 @@ module Cucumber
|
|
8
8
|
module Ast
|
9
9
|
describe ScenarioOutline do
|
10
10
|
before do
|
11
|
-
@step_mother = StepMother.new
|
11
|
+
@step_mother = Cucumber::StepMother.new
|
12
12
|
@step_mother.load_programming_language('rb')
|
13
13
|
@step_mother.load_natural_language('en')
|
14
14
|
@dsl = Object.new
|
15
|
-
@dsl.extend(RbSupport::RbDsl)
|
15
|
+
@dsl.extend(Cucumber::RbSupport::RbDsl)
|
16
16
|
|
17
17
|
@dsl.Given(/^there are (\d+) cucumbers$/) do |n|
|
18
18
|
@initial = n.to_i
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'cucumber/step_mother'
|
3
3
|
require 'cucumber/ast'
|
4
4
|
require 'cucumber/rb_support/rb_language'
|
@@ -7,11 +7,11 @@ module Cucumber
|
|
7
7
|
module Ast
|
8
8
|
describe Scenario do
|
9
9
|
before do
|
10
|
-
@step_mother = StepMother.new
|
10
|
+
@step_mother = Cucumber::StepMother.new
|
11
11
|
@step_mother.load_natural_language('en')
|
12
12
|
@step_mother.load_programming_language('rb')
|
13
13
|
@dsl = Object.new
|
14
|
-
@dsl.extend(RbSupport::RbDsl)
|
14
|
+
@dsl.extend(Cucumber::RbSupport::RbDsl)
|
15
15
|
|
16
16
|
$x = $y = nil
|
17
17
|
@dsl.Given /y is (\d+)/ do |n|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
|
3
3
|
module Cucumber
|
4
4
|
module Ast
|
@@ -6,8 +6,8 @@ module Cucumber
|
|
6
6
|
it "should convert And to Given in snippets" do
|
7
7
|
s1 = Step.new(1, 'Given', 'cukes')
|
8
8
|
s2 = Step.new(2, 'And', 'turnips')
|
9
|
-
s1.stub!(:language).and_return(Parser::NaturalLanguage.get(nil, 'en'))
|
10
|
-
s2.stub!(:language).and_return(Parser::NaturalLanguage.get(nil, 'en'))
|
9
|
+
s1.stub!(:language).and_return(Cucumber::Parser::NaturalLanguage.get(nil, 'en'))
|
10
|
+
s2.stub!(:language).and_return(Cucumber::Parser::NaturalLanguage.get(nil, 'en'))
|
11
11
|
c = StepCollection.new([s1, s2])
|
12
12
|
actual_keywords = c.step_invocations.map{|i| i.actual_keyword}
|
13
13
|
actual_keywords.should == %w{Given Given}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
3
3
|
require 'cucumber/ast/table'
|
4
4
|
|
5
5
|
module Cucumber
|
@@ -359,7 +359,7 @@ module Cucumber
|
|
359
359
|
lambda { @t.dup.diff!(t, :missing_row => false) }.should_not raise_error
|
360
360
|
end
|
361
361
|
|
362
|
-
it "should raise on surplus rows" do
|
362
|
+
it "should not raise on surplus rows when surplus is at the end" do
|
363
363
|
t = table(%{
|
364
364
|
| a | b |
|
365
365
|
| c | d |
|
@@ -369,6 +369,26 @@ module Cucumber
|
|
369
369
|
lambda { @t.dup.diff!(t, :surplus_row => false) }.should_not raise_error
|
370
370
|
end
|
371
371
|
|
372
|
+
it "should not raise on surplus rows when surplus is interleaved" do
|
373
|
+
t1 = table(%{
|
374
|
+
| row_1 | row_2 |
|
375
|
+
| four | 4 |
|
376
|
+
})
|
377
|
+
t2 = table(%{
|
378
|
+
| row_1 | row_2 |
|
379
|
+
| one | 1 |
|
380
|
+
| two | 2 |
|
381
|
+
| three | 3 |
|
382
|
+
| four | 4 |
|
383
|
+
| five | 5 |
|
384
|
+
})
|
385
|
+
lambda { t1.dup.diff!(t2) }.should raise_error
|
386
|
+
|
387
|
+
pending "http://groups.google.com/group/cukes/browse_thread/thread/5d96431c8245f05f" do
|
388
|
+
lambda { t1.dup.diff!(t2, :surplus_row => false) }.should_not raise_error
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
372
392
|
it "should raise on missing columns" do
|
373
393
|
t = table(%{
|
374
394
|
| a |
|
@@ -389,7 +409,7 @@ module Cucumber
|
|
389
409
|
end
|
390
410
|
|
391
411
|
def table(text, file=nil, line_offset=0)
|
392
|
-
@table_parser ||= Parser::TableParser.new
|
412
|
+
@table_parser ||= Cucumber::Parser::TableParser.new
|
393
413
|
@table_parser.parse_or_fail(text.strip, file, line_offset)
|
394
414
|
end
|
395
415
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'yaml'
|
3
3
|
|
4
4
|
module Cucumber
|
@@ -54,14 +54,14 @@ module Cli
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it "should require files in vendor/{plugins,gems}/*/cucumber/*.rb" do
|
57
|
-
given_the_following_files("/vendor/
|
58
|
-
"/vendor/
|
57
|
+
given_the_following_files("/vendor/gems/gem_a/cucumber/bar.rb",
|
58
|
+
"/vendor/plugins/plugin_a/cucumber/foo.rb")
|
59
59
|
|
60
60
|
config.parse!(%w{--require /features})
|
61
61
|
|
62
62
|
config.step_defs_to_load.should == [
|
63
|
-
"/vendor/
|
64
|
-
"/vendor/
|
63
|
+
"/vendor/gems/gem_a/cucumber/bar.rb",
|
64
|
+
"/vendor/plugins/plugin_a/cucumber/foo.rb"
|
65
65
|
]
|
66
66
|
end
|
67
67
|
|
@@ -139,7 +139,7 @@ module Cli
|
|
139
139
|
config.parse!([])
|
140
140
|
config.options[:require].should == ['from/yml']
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
143
|
it "parses ERB syntax in the cucumber.yml file" do
|
144
144
|
given_cucumber_yml_defined_as({'default' => '<%="--require some_file"%>'})
|
145
145
|
|
@@ -147,6 +147,16 @@ module Cli
|
|
147
147
|
config.options[:require].should include('some_file')
|
148
148
|
end
|
149
149
|
|
150
|
+
it "parses ERB in cucumber.yml that makes uses nested ERB sessions" do
|
151
|
+
given_cucumber_yml_defined_as(<<ERB_YML)
|
152
|
+
<%= ERB.new({'standard' => '--require some_file'}.to_yaml).result %>
|
153
|
+
<%= ERB.new({'enhanced' => '--require other_file'}.to_yaml).result %>
|
154
|
+
ERB_YML
|
155
|
+
|
156
|
+
config.parse!(%w(-p standard))
|
157
|
+
config.options[:require].should include('some_file')
|
158
|
+
end
|
159
|
+
|
150
160
|
it "provides a helpful error message when a specified profile does not exists in cucumber.yml" do
|
151
161
|
given_cucumber_yml_defined_as({'default' => '--require from/yml', 'html_report' => '--format html'})
|
152
162
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'yaml'
|
3
3
|
begin
|
4
4
|
require 'spec/runner/differs/default' # RSpec >=1.2.4
|
@@ -20,16 +20,16 @@ module Cucumber
|
|
20
20
|
describe "verbose mode" do
|
21
21
|
|
22
22
|
before(:each) do
|
23
|
-
@empty_feature = Ast::Feature.new(nil, Ast::Comment.new(''), Ast::Tags.new(2, []), "Feature", [])
|
23
|
+
@empty_feature = Cucumber::Ast::Feature.new(nil, Cucumber::Ast::Comment.new(''), Cucumber::Ast::Tags.new(2, []), "Feature", [])
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should show feature files parsed" do
|
27
27
|
@cli = Main.new(%w{--verbose example.feature}, @out)
|
28
28
|
@cli.stub!(:require)
|
29
29
|
|
30
|
-
FeatureFile.stub!(:new).and_return(mock("feature file", :parse => @empty_feature))
|
30
|
+
Cucumber::FeatureFile.stub!(:new).and_return(mock("feature file", :parse => @empty_feature))
|
31
31
|
|
32
|
-
@cli.execute!(StepMother.new)
|
32
|
+
@cli.execute!(Cucumber::StepMother.new)
|
33
33
|
|
34
34
|
@out.string.should include('example.feature')
|
35
35
|
end
|
@@ -80,7 +80,7 @@ module Cucumber
|
|
80
80
|
Object.should_receive(:const_get).with('ZooModule').and_return(mock_module)
|
81
81
|
mock_module.should_receive(:const_get).with('MonkeyFormatterClass').and_return(mock('formatter class', :new => f))
|
82
82
|
|
83
|
-
cli.execute!(StepMother.new)
|
83
|
+
cli.execute!(Cucumber::StepMother.new)
|
84
84
|
end
|
85
85
|
|
86
86
|
end
|
@@ -116,18 +116,17 @@ module Cucumber
|
|
116
116
|
|
117
117
|
end
|
118
118
|
|
119
|
-
|
119
|
+
[ProfilesNotDefinedError, YmlLoadError, ProfileNotFound].each do |exception_klass|
|
120
120
|
|
121
|
-
|
122
|
-
|
123
|
-
|
121
|
+
it "rescues #{exception_klass}, prints the message to the error stream and returns true" do
|
122
|
+
Configuration.stub!(:new).and_return(configuration = mock('configuration'))
|
123
|
+
configuration.stub!(:parse!).and_raise(exception_klass.new("error message"))
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
125
|
+
main = Main.new('', out = StringIO.new, error = StringIO.new)
|
126
|
+
main.execute!(Cucumber::StepMother.new).should be_true
|
127
|
+
error.string.should == "error message\n"
|
128
|
+
end
|
128
129
|
end
|
129
|
-
end
|
130
|
-
|
131
130
|
|
132
131
|
context "--drb" do
|
133
132
|
before(:each) do
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
3
|
require 'cucumber/formatter/html'
|
4
4
|
require 'nokogiri'
|
5
5
|
require 'cucumber/rb_support/rb_language'
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
3
|
|
4
4
|
require 'cucumber/formatter/junit'
|
5
5
|
require 'nokogiri'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'cucumber/formatter/progress'
|
3
3
|
|
4
4
|
module Cucumber
|
@@ -8,8 +8,8 @@ module Cucumber
|
|
8
8
|
before(:each) do
|
9
9
|
Term::ANSIColor.coloring = false
|
10
10
|
@out = StringIO.new
|
11
|
-
progress = Progress.new(mock("step mother"), @out, {})
|
12
|
-
@visitor = Ast::TreeWalker.new(nil, [progress])
|
11
|
+
progress = Cucumber::Formatter::Progress.new(mock("step mother"), @out, {})
|
12
|
+
@visitor = Cucumber::Ast::TreeWalker.new(nil, [progress])
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "visiting a table cell value without a status" do
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'cucumber/parser/natural_language'
|
3
3
|
|
4
4
|
module Cucumber
|
5
5
|
module Parser
|
6
6
|
describe Feature do
|
7
7
|
before do
|
8
|
-
@step_mother = StepMother.new
|
9
|
-
@parser = NaturalLanguage.get(@step_mother, 'en').parser
|
8
|
+
@step_mother = Cucumber::StepMother.new
|
9
|
+
@parser = Cucumber::Parser::NaturalLanguage.get(@step_mother, 'en').parser
|
10
10
|
end
|
11
11
|
|
12
12
|
after do
|
@@ -18,11 +18,11 @@ module Cucumber
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def parse_file(file)
|
21
|
-
FeatureFile.new(File.dirname(__FILE__) + "/../treetop_parser/" + file).parse(@step_mother, {})
|
21
|
+
Cucumber::FeatureFile.new(File.dirname(__FILE__) + "/../treetop_parser/" + file).parse(@step_mother, {})
|
22
22
|
end
|
23
23
|
|
24
24
|
def parse_example_file(file)
|
25
|
-
FeatureFile.new(File.dirname(__FILE__) + "/../../../examples/" + file).parse(@step_mother, {})
|
25
|
+
Cucumber::FeatureFile.new(File.dirname(__FILE__) + "/../../../examples/" + file).parse(@step_mother, {})
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "Comments" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
require 'treetop'
|
3
3
|
require 'cucumber/parser'
|
4
4
|
|
@@ -6,7 +6,7 @@ module Cucumber
|
|
6
6
|
module Parser
|
7
7
|
describe 'Tables' do
|
8
8
|
before do
|
9
|
-
@parser = NaturalLanguage.get(StepMother.new, 'en').parser
|
9
|
+
@parser = NaturalLanguage.get(Cucumber::StepMother.new, 'en').parser
|
10
10
|
end
|
11
11
|
|
12
12
|
after do
|
@@ -14,7 +14,7 @@ module Cucumber
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def parse(text)
|
17
|
-
@parser.
|
17
|
+
@parser.prepare_to_parse(text)
|
18
18
|
@parser.root = :table
|
19
19
|
table = @parser._nt_table
|
20
20
|
table.raw
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
|
3
3
|
require 'cucumber/ast'
|
4
4
|
require 'cucumber/step_mother'
|
@@ -8,11 +8,11 @@ module Cucumber
|
|
8
8
|
module RbSupport
|
9
9
|
describe RbStepDefinition do
|
10
10
|
before do
|
11
|
-
@step_mother = StepMother.new
|
11
|
+
@step_mother = Cucumber::StepMother.new
|
12
12
|
@step_mother.load_natural_language('en')
|
13
13
|
@rb = @step_mother.load_programming_language('rb')
|
14
14
|
@dsl = Object.new
|
15
|
-
@dsl.extend RbSupport::RbDsl
|
15
|
+
@dsl.extend Cucumber::RbSupport::RbDsl
|
16
16
|
@step_mother.before(mock('scenario', :null_object => true))
|
17
17
|
|
18
18
|
$inside = nil
|
@@ -32,7 +32,7 @@ module Cucumber
|
|
32
32
|
|
33
33
|
it "should allow calling of other steps with inline arg" do
|
34
34
|
@dsl.Given /Outside/ do
|
35
|
-
Given "Inside", Ast::Table.new([['inside']])
|
35
|
+
Given "Inside", Cucumber::Ast::Table.new([['inside']])
|
36
36
|
end
|
37
37
|
@dsl.Given /Inside/ do |table|
|
38
38
|
$inside = table.raw[0][0]
|
@@ -49,7 +49,7 @@ module Cucumber
|
|
49
49
|
|
50
50
|
lambda do
|
51
51
|
@step_mother.step_match('Outside').invoke(nil)
|
52
|
-
end.should raise_error(Undefined, 'Undefined step: "Inside"')
|
52
|
+
end.should raise_error(Cucumber::Undefined, 'Undefined step: "Inside"')
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should allow forced pending" do
|
@@ -59,7 +59,7 @@ module Cucumber
|
|
59
59
|
|
60
60
|
lambda do
|
61
61
|
@step_mother.step_match("Outside").invoke(nil)
|
62
|
-
end.should raise_error(Pending, "Do me!")
|
62
|
+
end.should raise_error(Cucumber::Pending, "Do me!")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should raise ArityMismatchError when the number of capture groups differs from the number of step arguments" do
|
@@ -68,7 +68,7 @@ module Cucumber
|
|
68
68
|
|
69
69
|
lambda do
|
70
70
|
@step_mother.step_match("No group: arg").invoke(nil)
|
71
|
-
end.should raise_error(ArityMismatchError)
|
71
|
+
end.should raise_error(Cucumber::ArityMismatchError)
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should allow announce" do
|