diff --git a/.circleci/config.yml b/.circleci/config.yml index 177c93e9..76b413e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,15 +11,35 @@ orbs: jobs: run-specs-with-postgres: - executor: solidusio_extensions/postgres + executor: + name: solidusio_extensions/postgres + ruby_version: '3.1' steps: - - browser-tools/install-browser-tools - - solidusio_extensions/run-tests + - checkout + - browser-tools/install-chrome + - solidusio_extensions/run-tests-solidus-master + - solidusio_extensions/store-test-results + run-specs-with-mysql: - executor: solidusio_extensions/mysql + executor: + name: solidusio_extensions/mysql + ruby_version: '3.0' + steps: + - checkout + - browser-tools/install-chrome + - solidusio_extensions/run-tests-solidus-current + - solidusio_extensions/store-test-results + + run-specs-with-sqlite: + executor: + name: solidusio_extensions/sqlite + ruby_version: '2.7' steps: - - browser-tools/install-browser-tools - - solidusio_extensions/run-tests + - checkout + - browser-tools/install-chrome + - solidusio_extensions/run-tests-solidus-older + - solidusio_extensions/store-test-results + lint-code: executor: solidusio_extensions/sqlite-memory steps: @@ -30,6 +50,7 @@ workflows: jobs: - run-specs-with-postgres - run-specs-with-mysql + - run-specs-with-sqlite - lint-code "Weekly run specs against master": @@ -43,3 +64,4 @@ workflows: jobs: - run-specs-with-postgres - run-specs-with-mysql + - run-specs-with-sqlite diff --git a/.rubocop.yml b/.rubocop.yml index 45161d45..df59fb56 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,8 @@ require: - solidus_dev_support/rubocop AllCops: - NewCops: enable + NewCops: disable + TargetRubyVersion: '2.7' Exclude: - sandbox/**/* - spec/dummy/**/* diff --git a/lib/paypal/paypal_http_client.rb b/lib/paypal/paypal_http_client.rb index a1ce43bf..a653549c 100644 --- a/lib/paypal/paypal_http_client.rb +++ b/lib/paypal/paypal_http_client.rb @@ -11,8 +11,8 @@ def initialize(environment, refresh_token = nil) super(environment) @refresh_token = refresh_token - add_injector { _1._sign_request } - add_injector { _1._add_headers } + add_injector(&:_sign_request) + add_injector(&:_add_headers) end def user_agent diff --git a/solidus_paypal_commerce_platform.gemspec b/solidus_paypal_commerce_platform.gemspec index bb49edb4..0a6486e5 100644 --- a/solidus_paypal_commerce_platform.gemspec +++ b/solidus_paypal_commerce_platform.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.metadata['changelog_uri'] = 'https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/releases' spec.metadata['rubygems_mfa_required'] = 'true' - spec.required_ruby_version = Gem::Requirement.new('>= 2.5') + spec.required_ruby_version = Gem::Requirement.new('>= 2.7') # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. diff --git a/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb b/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb index 8f6c193d..436a8c55 100644 --- a/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb +++ b/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb @@ -36,7 +36,7 @@ def Struct(data) # rubocop:disable Naming/MethodName let(:result) { Struct(purchase_units: [Struct(payments: payments)]) } let(:payments) { Struct(captures: [Struct(id: SecureRandom.hex(4))]) } - it "sends a purchase request to paypal" do # rubocop:disable Rspec/NoExpectationExample + it "sends a purchase request to paypal" do paypal_order_id = SecureRandom.hex(8) source = paypal_payment_method.payment_source_class.create(paypal_order_id: paypal_order_id) expect_request(:OrdersCaptureRequest).to receive(:new).with(paypal_order_id).and_call_original @@ -48,7 +48,7 @@ def Struct(data) # rubocop:disable Naming/MethodName let(:result) { Struct(purchase_units: [Struct(payments: payments)]) } let(:payments) { Struct(authorizations: [Struct(id: SecureRandom.hex(4))]) } - it "sends an authorize request to paypal" do # rubocop:disable Rspec/NoExpectationExample + it "sends an authorize request to paypal" do paypal_order_id = SecureRandom.hex(8) source = paypal_payment_method.payment_source_class.create(paypal_order_id: paypal_order_id) expect_request(:OrdersAuthorizeRequest).to receive(:new).with(paypal_order_id) @@ -87,7 +87,7 @@ def Struct(data) # rubocop:disable Naming/MethodName end describe "#void" do - it "sends a void request to paypal" do # rubocop:disable Rspec/NoExpectationExample + it "sends a void request to paypal" do authorization_id = SecureRandom.hex(8) source = paypal_payment_method.payment_source_class.create(authorization_id: authorization_id) payment.source = source