Posted about 1 month ago. Visible to the public. Repeats.

Cucumber's table diffing does not play nice with Spreewald's `patiently do`

Turns out, Cucumber::MultilineArgument::DataTable#diff! caches some stuff. Code of the following form will not work as intended:

Copy
Then('some table should look like') do |expected_table| patiently do actual_table = calculate_actual_table expected_table.diff!(actual_table) # not actually patient, will keep failing if it failed the first time end end

Instead, simply use

Copy
expected_table.dup.diff!(actual_table)
Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
about 1 month ago
by Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more