Closed dikond closed 4 years ago
I would support a separate slack-ruby-bot-rspec
gem, however that's not going to fix your problem if it were identical to what we have here and you required it. I suppose it would split development dependencies properly and so this wouldn't be an issue? Sounds like that's the fix here too.
So what you suggest sounds good to me. Without digging into it none of the shared matchers need VCR, or do they? Refactor those out.
none of the shared matchers need VCR
That's correct. I'll prepare a PR a bit later then.
@dblock may I ask you when do you plan to publish a new gem version?
@dblock may I ask you when do you plan to publish a new gem version?
Done.
Hola :v:
First of all thanks for your awesome project! We're happily using it for at least a year now in production. But today I spotted a minor problem. We're requiring
slack-ruby-bot/rspec
inspec_helper
(as it's noted in the README) which loads and configures VCR gem and it causing some unexpected exceptions to be raised by VCR, e.g.I'll add a few notes about our project setup:
slack-ruby-bot
You may see where it leads already. The exception above were a surprise because we don't even load our VCR helper with configuration in a given spec. We haven't spotted this problem immediately on
slack-ruby-bot/rspec
addition because most of the time we're running the whole suite and due to a load order our VCR configuration usually loaded shortly afterslack-ruby-bot/rspec/support/vcr
and overrides the config.I appreciate the effort to ship RSpec matchers and shared behaviour with this gem but these things do not require VCR as a dependency (I've checked how VCR is used).
I'd like to open up minimal PR to fix the issue, by excluding
support/vcr
from eager loading and require it only in the gem specs that need it. That's the cheapest way to fix the issue I guess. However, I think that such eager-loading may cause further problems of similar nature in the future. Ideally, I'd create a separate gem for RSpec shared matches and behaviours to physically split development dependencies and public API.