You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unit tests fail with a confusing and unhelpful error when it is run with an invalid API key. A new unit test should be added to verify that the provided API key validates before proceeding to other unit tests.
The only way I could think of to verify the API key was to issue a simple API request in the base TestCase and check the response, prior to running any of the tests. This led to the interesting discovery that Minitest doesn't have built-in support for something like before(:all), which is discussed in a lot of detail in this issue. I decided to include the minitest-hooks gem, which adds this functionality.
Now if an invalid API key is provided, this is detected and the test suite is aborted, i.e.:
$ ontologies_api_ruby_client git:(master) bundle exec rake test TESTOPTS="-v"
Run options: -v --seed 53341
# Running:
ABORTED! You must provide a valid API key.
rake aborted!
Command failed with status (1)
Unit tests fail with a confusing and unhelpful error when it is run with an invalid API key. A new unit test should be added to verify that the provided API key validates before proceeding to other unit tests.
relates to #14
The text was updated successfully, but these errors were encountered: