cucumber 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/History.txt +19 -0
  2. data/README.rdoc +1 -1
  3. data/Rakefile +2 -5
  4. data/VERSION.yml +1 -1
  5. data/cucumber.gemspec +12 -4
  6. data/examples/i18n/de/features/addition.feature +1 -1
  7. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +3 -3
  8. data/examples/self_test/features/step_definitions/sample_steps.rb +22 -22
  9. data/examples/tickets/features/half_manual.feature +11 -0
  10. data/examples/tickets/features/step_definitons/half_manual_steps.rb +11 -0
  11. data/features/announce.feature +97 -97
  12. data/features/background.feature +1 -4
  13. data/features/bug_475.feature +1 -2
  14. data/features/call_many_steps.feature +4 -6
  15. data/features/exception_in_after_block.feature +2 -3
  16. data/features/exception_in_after_step_block.feature +2 -3
  17. data/features/exception_in_before_block.feature +1 -2
  18. data/features/html_formatter/a.html +50 -40
  19. data/features/negative_tagged_hooks.feature +2 -3
  20. data/features/profiles.feature +2 -2
  21. data/features/report_called_undefined_steps.feature +2 -2
  22. data/features/rerun_formatter.feature +45 -0
  23. data/features/table_diffing.feature +1 -1
  24. data/features/table_mapping.feature +2 -3
  25. data/features/wire_protocol_table_diffing.feature +25 -0
  26. data/features/wire_protocol_tags.feature +47 -0
  27. data/lib/cucumber/ast/table.rb +2 -2
  28. data/lib/cucumber/cli/configuration.rb +1 -1
  29. data/lib/cucumber/cli/drb_client.rb +27 -16
  30. data/lib/cucumber/cli/profile_loader.rb +3 -2
  31. data/lib/cucumber/core_ext/proc.rb +1 -2
  32. data/lib/cucumber/formatter/console.rb +6 -4
  33. data/lib/cucumber/formatter/cucumber.css +10 -0
  34. data/lib/cucumber/formatter/cucumber.sass +10 -0
  35. data/lib/cucumber/formatter/html.rb +197 -186
  36. data/lib/cucumber/formatter/pdf.rb +24 -7
  37. data/lib/cucumber/formatter/rerun.rb +6 -3
  38. data/lib/cucumber/formatter/unicode.rb +1 -1
  39. data/lib/cucumber/languages.yml +7 -7
  40. data/lib/cucumber/parser/natural_language.rb +7 -0
  41. data/lib/cucumber/parser/treetop_ext.rb +1 -0
  42. data/lib/cucumber/rb_support/rb_world.rb +5 -0
  43. data/lib/cucumber/step_match.rb +4 -2
  44. data/lib/cucumber/step_mother.rb +53 -4
  45. data/lib/cucumber/wire_support/configuration.rb +11 -1
  46. data/lib/cucumber/wire_support/wire_language.rb +6 -3
  47. data/lib/cucumber/wire_support/wire_protocol.rb +2 -2
  48. data/lib/cucumber/wire_support/wire_protocol/requests.rb +26 -4
  49. data/spec/cucumber/ast/background_spec.rb +3 -3
  50. data/spec/cucumber/ast/feature_element_spec.rb +2 -2
  51. data/spec/cucumber/ast/feature_spec.rb +5 -5
  52. data/spec/cucumber/ast/outline_table_spec.rb +1 -1
  53. data/spec/cucumber/ast/py_string_spec.rb +1 -1
  54. data/spec/cucumber/ast/scenario_outline_spec.rb +3 -3
  55. data/spec/cucumber/ast/scenario_spec.rb +3 -3
  56. data/spec/cucumber/ast/step_collection_spec.rb +3 -3
  57. data/spec/cucumber/ast/step_spec.rb +1 -1
  58. data/spec/cucumber/ast/table_spec.rb +23 -3
  59. data/spec/cucumber/ast/tree_walker_spec.rb +1 -1
  60. data/spec/cucumber/broadcaster_spec.rb +1 -1
  61. data/spec/cucumber/cli/configuration_spec.rb +16 -6
  62. data/spec/cucumber/cli/drb_client_spec.rb +1 -1
  63. data/spec/cucumber/cli/main_spec.rb +13 -14
  64. data/spec/cucumber/cli/options_spec.rb +1 -1
  65. data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
  66. data/spec/cucumber/core_ext/proc_spec.rb +1 -1
  67. data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
  68. data/spec/cucumber/formatter/color_io_spec.rb +1 -1
  69. data/spec/cucumber/formatter/duration_spec.rb +1 -1
  70. data/spec/cucumber/formatter/html_spec.rb +2 -2
  71. data/spec/cucumber/formatter/junit_spec.rb +2 -2
  72. data/spec/cucumber/formatter/progress_spec.rb +3 -3
  73. data/spec/cucumber/parser/feature_parser_spec.rb +5 -5
  74. data/spec/cucumber/parser/table_parser_spec.rb +3 -3
  75. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +7 -7
  76. data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
  77. data/spec/cucumber/step_match_spec.rb +6 -1
  78. data/spec/cucumber/step_mother_spec.rb +18 -10
  79. data/spec/cucumber/tag_expression_spec.rb +88 -90
  80. data/spec/cucumber/wire_support/configuration_spec.rb +29 -12
  81. data/spec/cucumber/wire_support/connection_spec.rb +1 -1
  82. data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
  83. data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
  84. data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
  85. data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
  86. data/spec/cucumber/world/pending_spec.rb +5 -5
  87. 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
 
3
3
  module Cucumber::Ast
4
4
  describe OutlineTable 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 'cucumber/ast/py_string'
3
3
 
4
4
  module Cucumber
@@ -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,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'
@@ -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
 
3
3
  module Cucumber::Ast
4
4
  describe TreeWalker do
@@ -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
  describe Broadcaster 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 '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/plugins/plugin_a/cucumber/foo.rb",
58
- "/vendor/gems/gem_a/cucumber/bar.rb")
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/plugins/plugin_a/cucumber/foo.rb",
64
- "/vendor/gems/gem_a/cucumber/bar.rb"
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
 
3
3
 
4
4
  module Cucumber
@@ -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
- [ProfilesNotDefinedError, YmlLoadError, ProfileNotFound].each do |exception_klass|
119
+ [ProfilesNotDefinedError, YmlLoadError, ProfileNotFound].each do |exception_klass|
120
120
 
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"))
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
- main = Main.new('', out = StringIO.new, error = StringIO.new)
126
- main.execute!(StepMother.new).should be_true
127
- error.string.should == "error message\n"
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,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
@@ -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
@@ -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/core_ext/proc'
3
3
 
4
4
  describe Proc 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 'cucumber/formatter/ansicolor'
3
3
 
4
4
  module Cucumber
@@ -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/color_io'
3
3
 
4
4
  module Cucumber
@@ -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/duration'
3
3
 
4
4
  module Cucumber
@@ -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.__send__(:prepare_to_parse, text)
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