Writing tests in your projects is really important, especially because you need to make sure that things that have been implemented are already working as expected, and that future changes do not break something that is already working. In your projects, you may need to test that certain values are being assigned as expected, and sometimes trying to fix failing tests, or when writing new ones can be difficult to decipher the issue. Fortunately, a new Ruby gem has been implemented which is developed making this thing a lot easier.

Here are hashes, expected and actual, to be compared.

When you are trying to test certain values, you may have cases such as the following:

So instead of seeing such a long line which is really difficult to decipher and understand, you can use minitest_lucid. After you use this gem in your project, you will have a more easier way to understand the issues in your tests:

Even if you install it, you will still have to call it inside your test files, as you may not need it in each test file, thus making it easier for your overall project to have less things to carry on if they are not needed:

For the time being, this only works for Hash, Set, and Struct. According to the author of this gem, the support for Array and OpenStruct is coming soon.

 

This gem is open source and you can view its source code on Github. You can learn more about it in there, and also contribute and have the opportunity to keep an eye on the changes that may happen to it.