Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock HTTP calls in specs #17

Closed
dometto opened this issue Feb 17, 2020 · 4 comments
Closed

Mock HTTP calls in specs #17

dometto opened this issue Feb 17, 2020 · 4 comments

Comments

@dometto
Copy link
Contributor

dometto commented Feb 17, 2020

Getting this error on Travis, but not locally:

     Failure/Error: logger.error(message) if ::RubyDeps.enable_logging

A bit puzzled as this happens in spec_helper.rb:

load File.expand_path('../../lib/app.rb', __FILE__)
RubyDeps.set(:enable_logging, false)

Have fixed it temporarily by adding defined?(::RubyDeps) condition to the logger methods.

Additionally, I just noticed that the spec files are themselves being covered by simplecov:

Screenshot 2020-02-17 at 18 19 23

Seems like the RSpec environment is being set up quite right, but don't know what the issue is. 😕

@dometto
Copy link
Contributor Author

dometto commented Feb 17, 2020

Also, the specs are now actually doing HTTP queries. Does that make sense, or should we mock those?

@bartkamphorst
Copy link
Contributor

the specs are now actually doing HTTP queries

Those should be mocked for sure.

@bartkamphorst
Copy link
Contributor

The issues with SimpleCov should be fixable by adding a .simplecov config file, and perhaps explicitly adding filters to exclude _spec.rb files. See simplecov-ruby/simplecov#340 .

@dometto dometto changed the title Test issues Mock HTTP calls in specs Feb 18, 2020
@dometto
Copy link
Contributor Author

dometto commented Feb 18, 2020

Thanks for the pointer! SimpleCov now working locally, and got CoverAlls to work on Travis. Leaving this issue open as a reminder to mock the HTTP calls.

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

No branches or pull requests

2 participants