A more helpful way to view differences between complex data structures in RSpec.
19-Nov-2020 1391
The primary motivation behind this gem is to vastly improve upon RSpec's built-in diffing capabilities.Sometimes, whenever you use a matcher such as eq, match, include, or have_attributes, you will get a diff of the two data structures you are trying to match against. This is great if all you want to do is compare multi-line strings. But if you want to compare other, more "real world" kinds of values, such as what you might work with when developing API endpoints or testing methods that make database calls and return a set of model objects, then you are out of luck. Since RSpec merely runs your expected and actual values through Ruby's PrettyPrinter library and then performs a diff of these strings, the output it produces leaves much to be desired.
A more helpful way to view differences between complex data structures in RSpec. #ruby #rubydeveloper #rubyonrails #helpful #differences #between #complex #structures #RSpec. #rspec. https://rubyonrails.ba/link/a-more-helpful-way-to-view-differences-between-complex-data-structures-in-rspec