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

Do you have testing stubs? #530

Closed
ysyyork opened this issue Apr 17, 2017 · 8 comments
Closed

Do you have testing stubs? #530

ysyyork opened this issue Apr 17, 2017 · 8 comments

Comments

@ysyyork
Copy link

ysyyork commented Apr 17, 2017

Do you provide testing stubs? Or I have to write by myself?

@brandur-stripe
Copy link
Contributor

Hi @ysyyork,

Short answer: no. I want to get something tooled around this (and I think it'll happen relatively soon), but we're not shipping any official testing package right now.

Longer answer if you're willing to get your hands a bit dirty: the test suite in this repository uses a Committee-based testing stub that's powered by our OpenAPI schema. You could basically vendor in the code found in this file along with the schema, and you'll have a fairly accurate set of testing stubs.

I'm going to close this out for now as a dup of #243, but let me know if you have any other questions.

@joshm1204
Copy link

What’s the answer to this request? Any movement on development?

@brandur-stripe
Copy link
Contributor

@joshm1204 Check out stripe-mock. It's still not as fully-featured of a solution as we'd like to eventually provide (see the README for a detailed list of features and missing features), but it's working as a test solution for a lot of our projects, and it may work for you.

@YSavir
Copy link

YSavir commented Jun 25, 2019

@brandur-stripe Thanks for linking to stripe-mock. I was just checking it out, too, and have it running locally.

As for using it for testing my own projects, is there a recommended way to configure stripe-ruby to use the local server?

@ob-stripe
Copy link
Contributor

@YSavir You can change the base URL used by stripe-ruby:

Stripe.api_base = 'http://localhost:12111'

@YSavir
Copy link

YSavir commented Jun 25, 2019

@ob-stripe awesome, thanks!

And thanks for making the stripe gem easy to work with. :)

@joshm1204
Copy link

joshm1204 commented Jun 26, 2019

@brandur-stripe stripe-mock, looks like a whole server, to avoid excess components it would be nice to have some basic stubs. Is there a way to use stripe-mock without installing a separate server?

Is Stripe going to come out with anything like https://github.com/rebelidealist/stripe-ruby-mock? Its more light weight, but the disadvantage of stripe-ruby-mock is that it's not maintained by stripe and it always lagging. stripe-ruby-mock, can run a thin server to persist data, but it's not required to use it.

@brandur-stripe
Copy link
Contributor

Hi @joshm-stripe,

Is Stripe going to come out with anything like https://github.com/rebelidealist/stripe-ruby-mock? Its more light weight, but the disadvantage of stripe-ruby-mock is that it's not maintained by stripe and it always lagging. stripe-ruby-mock, can run a thin server to persist data, but it's not required to use it.

Maybe eventually, but we don't currently have one in the works. One thing we'd need to do for a project like that is make sure we could built it sustainably, as manual maintenance on a like package in seven languages would be a heavy ongoing burden.

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

5 participants