Closed odlp closed 7 years ago
👍
@odlp it looks like this (awesome) PR never ended up in a release anywhere. Would you mind cutting a new release to RubyGems sometime?
@samcday good spot - I just released v0.1.0
to Rubygems: https://rubygems.org/gems/fake_stripe/versions/0.1.0
Requiring
fake_stripe
is slow because it boots the Stripe JS server immediately, even whenFakeStripe.stub_stripe
hasn't been called yet.This PR proposes:
STRIPE_JS_HOST
can be populated correctly.Impact
By deferring spinning up a Capybara server until necessary there's a significant improvement on the time to require the gem.
Running command:
Motivation
When I run an non-Stripe related test I don't want to experience the performance penalty. Today one would have to use the following in a Gemfile & explicitly require
fake_stripe
later:After this PR there's far less performance impact of a vanilla require
fake_stripe
in the Gemfile like: