cucumber/cucumber — Issue #223: diff! not recognizing correct rows?
Author: emiltin
Created: 2012-02-11 19:02:03+00:00
State: open

suppose i have this table in my scenario:

```
Then I should see
| size |
| 1 |
| 2 |
| 3 |
```

if i diff! this with:

Then /^I should see$/ do |table|
table.diff! [
{'size'=>'1'},
{'size'=>'2'},
{'size'=>'3'}
]
end

then all three rows are green as expected when i run the scenario. but if i compare with:

Then /^I should see$/ do |table|
table.diff! [
{'size'=>'x'},
{'size'=>'2'},
{'size'=>'x'}
]
end

then all three rows are marked as wrong, even though row 2 is in fact correct. from the terminal output:

```
Then I should see # features/step_definitions/routing.rb:236
| size |
| 1 | <-- yellow
| 2 | <-- yellow
| x | <-- grey
| 3 | <-- yellow
| 2 | <-- grey
| x | <-- grey
Tables were not identical (Cucumber::Ast::Table::Different)
```

why is row 2 not recognized as correct? it shows up in both yellow and grey.

it seems to dependend on the order of the rows. if the first or last row in this example is correct, and the two other incorrect, there are no problem, only if it's in the middle.

i tried using and array of arrays instead, with the column headers as the first row, but get the same result.