Skip to content

Commit

Permalink
rubocop -a
Browse files Browse the repository at this point in the history
  • Loading branch information
aldesantis committed Dec 13, 2019
1 parent 4652822 commit 2e7d638
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'bundler'

begin
Expand Down
2 changes: 2 additions & 0 deletions lib/solidus_support.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'solidus_support/version'
require 'solidus_support/migration'
require 'solidus_support/engine_extensions'
Expand Down
2 changes: 2 additions & 0 deletions lib/solidus_support/engine_extensions.rb
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# frozen_string_literal: true

require_relative 'engine_extensions/decorators'
2 changes: 2 additions & 0 deletions lib/solidus_support/migration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module SolidusSupport
module Migration
def self.[](version)
Expand Down
4 changes: 3 additions & 1 deletion lib/solidus_support/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module SolidusSupport
VERSION = '0.4.0'.freeze
VERSION = '0.4.0'
end
12 changes: 8 additions & 4 deletions spec/solidus_support_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

RSpec.describe SolidusSupport do
describe '.payment_method_parent_class' do
subject { described_class.payment_method_parent_class(credit_card: credit_card) }
Expand All @@ -10,32 +12,34 @@
end
end

context 'For Solidus < 2.3' do
context 'with Solidus < 2.3' do
let(:solidus_version) { '2.2.1' }

it { is_expected.to eq(Spree::Gateway) }
end

context 'For Solidus >= 2.3' do
context 'with Solidus >= 2.3' do
let(:solidus_version) { '2.3.1' }

it { is_expected.to eq(Spree::PaymentMethod) }
end

# rubocop:disable RSpec/NestedGroups
context 'with credit_card: true' do
let(:credit_card) { true }

context 'For Solidus < 2.3' do
context 'with Solidus < 2.3' do
let(:solidus_version) { '2.2.1' }

it { is_expected.to eq(Spree::Gateway) }
end

context 'For Solidus >= 2.3' do
context 'with Solidus >= 2.3' do
let(:solidus_version) { '2.3.1' }

it { is_expected.to eq(Spree::PaymentMethod::CreditCard) }
end
end
# rubocop:enable RSpec/NestedGroups
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require_relative 'support/dummy_app'
require 'solidus_extension_dev_tools/rspec/spec_helper'
2 changes: 2 additions & 0 deletions spec/support/dummy_app.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ENV['RAILS_ENV'] = 'test'
ENV['DISABLE_DATABASE_ENVIRONMENT_CHECK'] = '1'

Expand Down

0 comments on commit 2e7d638

Please sign in to comment.