when using the Then the JSON should have the following-assertion in cucumber like so:
Then the JSON should have the following
Then the JSON should have the following:
| string | "string |
| integer | 42 |
the first line of the table was interpreted as a table header and skipped. The attached patch fixes that.
I don't really know how to write a proper test for that.
make "the JSON should have the following" not skip the first assertion
Thank you! 👏
Could you take a stab at writing a test for this? What comes to mind is duplicating how you came across this bug. Write a table that should fail (and wouldn't have before your fix) and assert that it does indeed fail. Does that make sense? If not, I can try later, just not now. 😜 Thanks again.
Any progress on this? Thanks.
Could this patch be applied? The issue bit me as well, since the README is completely wrong. The code assumes there is a table header -- because it iterates over table.rows -- while the README examples have no header. Either the README examples need to have a table header, or the code needs to be changed to use table.rows_hash.
@vocaro Not without tests. If you could write a test surrounding the fix, that'd be wonderful. Otherwise, I'll get to it when I can. Thank you!
+1 for merging this.
I'm not sure there's a good way to write a test for this fix. The only thing I could come up with was to add a tag like @wip (maybe @fail) that makes the scenario pass only if it fails. But that seems to violate the spirit of Given - When - Then.