#ed-stripe-mock

1 messages · Page 1 of 1 (latest)

lunar crownBOT
flat fractal
#

ed-stripe-mock

meager mirage
#

Thanks; I understand that stripe-mock is a server written in Go, but ... I don't know how exactly to use it in my ruby spec tests. Do I need to configure the Stripe ruby gem in my Ruby app to connect to port 4999 (somehow)?

flat fractal
meager mirage
#

Thanks. What would help me get going fastest would be a simple example app that tests stripe. I see StripeMock is in stripe-ruby/test/stripe_mock.rb , but I'm not sure how to use it...

#

Maybe I call StripeMock.start ..?

flat fractal
#

those are for stripe-ruby to run its own tests

meager mirage
#

Thanks, but ... why do the usage instructions for stripe mock make no mention of how to configure stripe.rb to actually use the mock? Seems like a pretty common thing to do. I can fumble around and come up with something, but ... it seems like what I'm doing has got to be one of the most common ways to use stripe-mock. I think I need something like:

#

setup do
Stripe.api_key = "sk_test_123"
Stripe.api_base = "http://localhost:#{MOCK_PORT}"

    stub_connect
  end
#

Stripe.api_base being the thing that is not mentioned in stripe-mock instructions anywhere, AFAICT...

flat fractal
#

where in stripe-mock is that^?

#

looks like something in Ruby no?

meager mirage
#

That snippet is from stripe-ruby/test/test_helper.rb .

#

Yes, it's not in stripe-mock. But shouldn't this be in stripe-mock's README so that those who use stripe-mock can discover how to configure stripe.rb (or stripe.whatever) to use the alternate hostname and port?

#

Or am I simply looking in the wrong place and there is some other documentation that explains this?

narrow axle
#

👋 hopping in here since hmunoz has to head out