Skip to content

Commit

Permalink
Merge pull request #29 from aldesantis/dev-tools
Browse files Browse the repository at this point in the history
Introduce solidus_extension_dev_tools
  • Loading branch information
kennyadsl authored Dec 13, 2019
2 parents 1b87714 + 2e7d638 commit 13980a1
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
/spec/reports/
/tmp/
/log/
/spec/

10 changes: 2 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
Metrics/BlockLength:
ExcludedMethods: ['describe', 'context']

Metrics/LineLength:
Max: 100

Style/Documentation:
Enabled: false
require:
- solidus_extension_dev_tools/rubocop
3 changes: 3 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 All @@ -6,5 +8,6 @@ gem 'solidus_core', github: 'solidusio/solidus', branch: branch
# Specify your gem's dependencies in solidus_support.gemspec
gemspec

gem 'solidus_extension_dev_tools', github: 'solidusio-contrib/solidus_extension_dev_tools'
gem 'sprockets-rails'
gem 'sqlite3'
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
7 changes: 4 additions & 3 deletions solidus_support.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files -z`.split("\x0")
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.14'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec-rails', '~> 3.7'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec-rails'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'solidus_core'
spec.add_development_dependency 'solidus_extension_dev_tools'
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
4 changes: 3 additions & 1 deletion 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_support/extension/spec_helper'
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 13980a1

Please sign in to comment.