aslakhellesoy-cucumber 0.3.102.2 → 0.3.103

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,18 @@ 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, {})
11
+ progress = Progress.new(mock("step mother"), @out, {})
12
+ @visitor = Ast::TreeWalker.new(nil, [progress])
12
13
  end
13
14
 
14
15
  describe "visiting a table cell value without a status" do
15
16
  it "should take the status from the last run step" do
16
- @progress.visit_step_result('', '', nil, :failed, nil, 10, nil)
17
- @progress.visit_table_cell_value('value', nil)
17
+ @visitor.visit_step_result('', '', nil, :failed, nil, 10, nil)
18
+ outline_table = mock()
19
+ outline_table.should_receive(:accept) do |visitor|
20
+ visitor.visit_table_cell_value('value', nil)
21
+ end
22
+ @visitor.visit_outline_table(outline_table)
18
23
 
19
24
  @out.string.should == "FF"
20
25
  end
@@ -22,7 +27,7 @@ module Cucumber
22
27
 
23
28
  describe "visiting a table cell which is a table header" do
24
29
  it "should not output anything" do
25
- @progress.visit_table_cell_value('value', :skipped_param)
30
+ @visitor.visit_table_cell_value('value', :skipped_param)
26
31
 
27
32
  @out.string.should == ""
28
33
  end
@@ -361,34 +361,38 @@ Given I am a step
361
361
 
362
362
  describe "Filtering" do
363
363
  it "should filter outline tables" do
364
- ff = FeatureFile.new(
365
- File.dirname(__FILE__) + '/../../../examples/self_test/features/outline_sample.feature:12')
366
- f = ff.parse(@step_mother, {:lang => 'en'})
367
- f.to_sexp.should ==
364
+ path = '/self_test/features/outline_sample.feature'
365
+ f = parse_example_file("#{path}:12")
366
+ actual_sexp = f.to_sexp
367
+
368
+ # check path is equivalent, if not same
369
+ File.expand_path(actual_sexp[1]).should == File.expand_path(File.dirname(__FILE__) + "/../../../examples#{path}")
370
+ actual_sexp[1] = 'made/up/path.feature'
371
+ actual_sexp.should ==
368
372
  [:feature,
369
- "./spec/cucumber/parser/../../../examples/self_test/features/outline_sample.feature",
370
- "Feature: Outline Sample",
371
- [:scenario_outline,
372
- "Scenario Outline:",
373
- "Test state",
374
- [:step, 6, "Given", "<state> without a table"],
375
- [:step, 7, "Given", "<other_state> without a table"],
376
- [:examples,
377
- "Examples:",
378
- "Rainbow colours",
379
- [:table,
380
- [:row, 9, [:cell, "state"], [:cell, "other_state"]],
381
- # [:row, 10, [:cell, "missing"], [:cell, "passing"]],
382
- # [:row, 11, [:cell, "passing"], [:cell, "passing"]],
383
- [:row, 12, [:cell, "failing"], [:cell, "passing"]]]]
384
- # ,
385
- # [:examples,
386
- # "Examples:",
387
- # "Only passing",
388
- # [:table,
389
- # [:row, 14, [:cell, "state"], [:cell, "other_state"]],
390
- # [:row, 15, [:cell, "passing"], [:cell, "passing"]]]]]
391
- ]]
373
+ 'made/up/path.feature',
374
+ "Feature: Outline Sample",
375
+ [:scenario_outline,
376
+ "Scenario Outline:",
377
+ "Test state",
378
+ [:step, 6, "Given", "<state> without a table"],
379
+ [:step, 7, "Given", "<other_state> without a table"],
380
+ [:examples,
381
+ "Examples:",
382
+ "Rainbow colours",
383
+ [:table,
384
+ [:row, 9,
385
+ [:cell, "state"],
386
+ [:cell, "other_state"]
387
+ ],
388
+ [:row, 12,
389
+ [:cell, "failing"],
390
+ [:cell, "passing"]
391
+ ]
392
+ ]
393
+ ]
394
+ ]
395
+ ]
392
396
  end
393
397
  end
394
398
  end
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.3.102.2
4
+ version: 0.3.103
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"