ruby - RSpec argument match array of hashes -
I would like to use logic matchers provided by rspec to match an array of hash The code is:
reference 'entering the stock level' subject (double: stock_logger, stock_expected: zero)} (go to: stock_importor) {description_clash.New (logar: subject) }} Before (: each) {stock_importer.import} it is {is_expected.to (Recovery): (with array_including (hask_only ('sku', 'count_on_hand'))}}
This error happened to me with a logic mismatch. The only working solution I can come up with is:
Reference 'Level of logging stock' topic {double (: stock_logger , Stock_expected: zero)} (let's stock_importor) {described_class} new (wood: subject)} before (: each) {stock_importer.import} this is_expected.to (to get: stock_ updated) do | stock_levels | Expectancy (stock_level) to include ('scooo', 'count_on_hand')) What was I doing something wrong?
Try array_including
but with the hash key (included in "squa") ), ("Bar"), end
is not like that. Code>
Comments
Post a Comment