Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an argument for test_faker_stripe.rb (#1702)
This PR fixes an argument for test_faker_stripe.rb. This change was hidden by the same `ArgumentError` in different messages. ## Expected error ```console Faker::Stripe.valid_card(card_type: Faker::Lorem.word) # => ArgumentError: Valid credit cards argument can be left blank or include # visa, visa_debit, mc, mc_2_series, mc_debit, mc_prepaid, amex, amex_2, # discover, discover_2, diners_club, diners_club_2, jcb # from /Users/koic/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faker-2.1.2/lib/faker/default/stripe.rb:13:in # `valid_card' ``` ```console Faker::Stripe.invalid_card(card_error: Faker::Lorem.word) # => ArgumentError: Invalid credit cards argument can be left blank or # include addressZipFail, addressFail, zipFail, addressZipUnavailable, # cvcFail, customerChargeFail, successWithReview, declineCard, # declineFraudulentCard, declineIncorrectCvc, declineExpired, # declineProcessingError, declineIncorrectNumber # from /Users/koic/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faker-2.1.2/lib/faker/default/stripe.rb:43:in # `invalid_card' ``` ## Actual error ```console Faker::Stripe.valid_card(Faker::Lorem.word) # => ArgumentError: wrong number of arguments (given 1, expected 0) # from /Users/koic/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faker-2.1.2/lib/faker/default/stripe.rb:6:in # `valid_card' ``` ```console Faker::Stripe.invalid_card(Faker::Lorem.word) # => ArgumentError: wrong number of arguments (given 1, expected 0) # from /Users/koic/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/faker-2.1.2/lib/faker/default/stripe.rb:36:in # `invalid_card' ``` This was found by running the test with #1698. ```console % bundle exec rake test Loaded suite /Users/koic/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.1/lib/rake/rake_test_loader Started (snip) /Users/koic/src/github.com/faker-ruby/faker/test/faker/default/test_faker_stripe.rb:38: Passing `card_error` with the 1st argument of `Stripe.invalid_card` is deprecated. Use keyword argument like `Stripe.invalid_card(card_error: ...)` instead. /Users/koic/src/github.com/faker-ruby/faker/test/faker/default/test_faker_stripe.rb:16: Passing `card_type` with the 1st argument of `Stripe.valid_card` is deprecated. Use keyword argument like `Stripe.valid_card(card_type: ...)` instead. ```
- Loading branch information