Ruby Challenges - Sudoku Validator

Continuing the discussion from New trail: Ruby Challenges:

Hi Philip!

I think you might be misreading the expectation.

It looks like this:

 expect(result).to(
          eq("This sudoku is invalid."),
          "Expected #{fixture} to be invalid but it wasn't."
        )

The second argument to to is a string that provides a custom failure message when the expectation is not satisfied.

So, this code says “result should be equal to ‘This sudoku is invalid.’, but if it’s not, output the string 'Expected #{fixture_name} to be invalid but it wasnt.”.

In other words, the Validator does not know, and should not care about the name of the file.

Does that make sense?

More info on custom error messages: https://www.relishapp.com/rspec/rspec-expectations/v/3-2/docs/customized-message