Upgrade to Rubocop 0.80 (#903)

Just noticed that a new version of Rubocop came out today. The upgrade
seemed relatively painless, so just went for it.
This commit is contained in:
Brandur 2020-02-18 10:41:55 -08:00 committed by GitHub
parent 69e19fa6bd
commit 554f18b850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -58,6 +58,15 @@ Style/AccessModifierDeclarations:
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/NumericPredicate:
Enabled: false

View File

@ -21,7 +21,7 @@ group :development do
# `Gemfile.lock` checked in, so to prevent good builds from suddenly going
# bad, pin to a specific version number here. Try to keep this relatively
# up-to-date, but it's not the end of the world if it's not.
gem "rubocop", "0.79"
gem "rubocop", "0.80"
platforms :mri do
gem "byebug"

View File

@ -213,28 +213,28 @@ module Stripe
should "mass assign values with #update_attributes" do
obj = Stripe::StripeObject.construct_from(id: 1, name: "Stripe")
obj.update_attributes({ name: "STRIPE" }) # rubocop:disable Style/BracesAroundHashParameters
obj.update_attributes({ name: "STRIPE" })
assert_equal "STRIPE", obj.name
# unfortunately, we even assign unknown properties to duplicate the
# behavior that we currently have via magic accessors with
# method_missing
obj.update_attributes({ unknown: "foo" }) # rubocop:disable Style/BracesAroundHashParameters
obj.update_attributes({ unknown: "foo" })
assert_equal "foo", obj.unknown
end
should "#update_attributes with a hash" do
obj = Stripe::StripeObject.construct_from({})
obj.update_attributes({ metadata: { foo: "bar" } }) # rubocop:disable Style/BracesAroundHashParameters
obj.update_attributes({ metadata: { foo: "bar" } })
assert_equal Stripe::StripeObject, obj.metadata.class
end
should "create accessors when #update_attributes is called" do
obj = Stripe::StripeObject.construct_from({})
assert_equal false, obj.send(:metaclass).method_defined?(:foo)
obj.update_attributes({ foo: "bar" }) # rubocop:disable Style/BracesAroundHashParameters
obj.update_attributes({ foo: "bar" })
assert_equal true, obj.send(:metaclass).method_defined?(:foo)
end
@ -271,7 +271,7 @@ module Stripe
should "#serialize_params on a basic object" do
obj = Stripe::StripeObject.construct_from(foo: nil)
obj.update_attributes({ foo: "bar" }) # rubocop:disable Style/BracesAroundHashParameters
obj.update_attributes({ foo: "bar" })
assert_equal({ foo: "bar" }, obj.serialize_params)
end