Skip to content

Conversation

@kohrVid
Copy link

@kohrVid kohrVid commented Sep 19, 2022

Closes: #1
WIP - Adding tests to the gem

Though the gem will support non-Rails applications, I have decided to
use the `:rails` profile in SimpleCov as this was the easiest way to
ensure that the correct files were added to the code coverage
statistics.
This is a Rails method [1] used in the Base class. In order to support
non-rails applications, it's necessary to monkeypatch the Hash class.

[1]: https://apidock.com/rails/v5.2.3/Hash/transform_values
This commit adds a test to ensure that a new Message instance is created
when the `Base#mail` method is called. In order to do this, it was
necessary to add a new private method to the Base class as the
`instance_variable_names` method called is a Rails-only method [1] and
so would have raised an exception in a non-Rails application.

[1]: https://apidock.com/rails/v5.2.3/Object/instance_variable_names
Copy link
Member

@hammady hammady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write tests for the gem

2 participants