Skip to content

Commit

Permalink
Fix #83, make Scenario Outline Test Case names language neutral.
Browse files Browse the repository at this point in the history
  • Loading branch information
brasmusson committed Mar 15, 2015
1 parent 0d236be commit 0084962
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## [In Git](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.1...master)

* Your change here?
### New Features

* Make Test Case names for Scenario Outlines language neutral [83](https://github.com/cucumber/cucumber-ruby-core/pull/83) (@brasmusson)

##
[v1.1.1](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.1...v1.1.1)
## [v1.1.1](https://github.com/cucumber/cucumber-ruby-core/compare/v1.1.0...v1.1.1)


### New Features
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/core/test/case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def examples_table(table)
end

def examples_table_row(row)
@result = " (row #{row.number})"
@result = " (##{row.number})"
self
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/cucumber/core/test/case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ module Test
end
receiver = double.as_null_object
expect( receiver ).to receive(:test_case) do |test_case|
expect( test_case.name ).to eq 'outline name, examples name (row 1)'
expect( test_case.name ).to eq 'outline name, examples name (#1)'
expect( test_case.keyword ).to eq 'Scenario Outline'
end.once.ordered
expect( receiver ).to receive(:test_case) do |test_case|
expect( test_case.name ).to eq 'outline name, examples name (row 2)'
expect( test_case.name ).to eq 'outline name, examples name (#2)'
end.once.ordered
expect( receiver ).to receive(:test_case) do |test_case|
expect( test_case.name ).to eq 'outline name, Examples (row 1)'
expect( test_case.name ).to eq 'outline name, Examples (#1)'
end.once.ordered
compile [gherkin], receiver
end
Expand Down Expand Up @@ -378,7 +378,7 @@ module Test
end

let(:test_case) do
test_cases.find { |c| c.name == "two, x1 (row 1)" }
test_cases.find { |c| c.name == "two, x1 (#1)" }
end

it 'matches the precise location of the scenario outline examples table row' do
Expand Down
2 changes: 1 addition & 1 deletion spec/cucumber/core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module Cucumber
it "filters out test cases based on a tag expression" do
visitor = double.as_null_object
expect( visitor ).to receive(:test_case) do |test_case|
expect( test_case.name ).to eq 'foo, bar (row 1)'
expect( test_case.name ).to eq 'foo, bar (#1)'
end.exactly(1).times

gherkin = gherkin do
Expand Down

0 comments on commit 0084962

Please sign in to comment.