shouldly/shouldly — Issue #37: Truncate error string "actual" output to 100 chars
Author: xerxesb
Created: 2011-11-01 22:12:39+00:00
State: open

When calling a Should* method on a string argument for text matching, the error message will print the full content of the actual value. Most of the time this is fine as the content being asserted is usually small(ish).

Sometimes (particularly in the case of ShouldContain) there might be a larger content block being asserted against which means the error message will put out a lot of content, mostly unnecessary.

This change is to truncate the "actual" output after a string assertion has failed and limit to 100 chars. The idea was born out of Issue #35, and the number of 100 characters was an arbitrary number I pulled out of my arse. (i.e. i'm happy to re-evaluate if 100 seems insufficient)