In: depot_c/test/unit/product_test.rb (early in the book - sorry reading on iPad)
I noticed that on the test “product is not valid without a unique title”, the assertion at the end “assert_equal” uses an argument on the join when comparing the error message.
For this particular test, we know what the error should be and there should only be one. Would it be safe to say that the argument that’s passed on the join is pointless (’; ‘)?
as opposed to just:
From what I understand, the argument is used to combine multiple values of an array (so if you put a dash the resulting string would list the values separated by a dash), but in this case we know that the array in the errors hash for :title will only have one value.
PS. This is my attempt to completely understand everything as I read. I really want to get it this time around!
PSS. Is this what people describe when they talk about “elegant” coding or is this just a simple refactor?