stripe-ruby-mock: stripe-ruby v5 brings breaking changes

I’ve been looking into why the test suite is failing, and one of the major items is that stripe-ruby v5 has been released about 7 days ago. This includes a bunch of breaking changes, which means this test suite fails. For example, calls in the test suite to Stripe::Account.all work fine on v4 but fail on v5.

stripe-ruby-mock currently has a dependency range of 'stripe', '>= 2.0.3'. Since there is no upper bound on the contraint, travis will use the latest release i.e. v5, even though the test suite is targetting v4. However, I don’t think supporting stripe-ruby v4 and v5 at the same time is practical, given examples like the above.

What do you think is the best approach?

My personal suggestion would be:

  • constrain the stripe dependency to be ‘>= 2.0.3’, ‘< 5’ in the gemspec
  • get the test suite working on travis again
  • make a PR that just changes the stripe dependency to ‘~> 5.0’ along with whichever changes are necessary to get the tests passing
  • then release a new version of stripe-ruby-mock

Alternative approaches include just changing the dependency to >= 5 today, even though the tests won’t pass. This would then at least indicate that maintaining compatibility to stripe v4 isn’t necessary, and we can then fix up the tests.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Upgrading to 3.1.0.rc2 as per @crispinheneise worked for me! I was also getting ArgumentError: wrong number of arguments (given 3, expected 2)

gem 'stripe-ruby-mock', '~> 3.1.0.rc2', require: 'stripe_mock'

I’m using stripe-ruby-mock’, ‘~> 3.0.1’ and still getting

ArgumentError: wrong number of arguments (given 3, expected 2) from trying to do

let(:customer) do Stripe::Customer.create({email: 'johnny@appleseed.com', source: StripeMock.create_test_helper.generate_card_token}) end

I am afraid it will be a lot of trouble to fix the tests suite with both v4 first and then v5. I would agree to go straight for >= 5 support.

Upgrading to 3.1.0.rc2 should fix the ArgumentError.

  gem 'stripe-ruby-mock', '~> 3.1.0.rc2', require: 'stripe_mock'

I can confirm this worked for me.

Upgrading to 3.1.0.rc2 should fix the ArgumentError.

  gem 'stripe-ruby-mock', '~> 3.1.0.rc2', require: 'stripe_mock'

thank you very much guys. Let’s go by this way:

  • constrain the stripe dependency to be ‘>= 2.0.3’, ‘< 5’ in the gemspec

I want to merge as much as possible PRs this week and release 2.5.9.

Then merge PRs with label “will be merged soon” and release it as version 3.0.0.

thank you for your help. We all use this nice tool.