Sha256: 55db44c7da7c1520885f4a43c47ebec50badc46d59cc570150c2015bcff1de5d
Contents?: true
Size: 1.63 KB
Versions: 2
Compression:
Stored size: 1.63 KB
Contents
# frozen_string_literal: true require 'rake' require 'pathname' module SolidusDevSupport class RakeTasks include Rake::DSL def self.install(*args) new(*args).tap(&:install) end def initialize(root: Dir.pwd) @root = Pathname(root) @test_app_path = @root.join(ENV['DUMMY_PATH'] || 'spec/dummy') @gemspec = Bundler.load_gemspec(@root.glob("{,*}.gemspec").first) end attr_reader :test_app_path, :root, :gemspec def install install_test_app_task install_rspec_task end def install_test_app_task require 'rake/clean' ::CLOBBER.include test_app_path ENV['DUMMY_PATH'] = test_app_path.to_s ENV['LIB_NAME'] = gemspec.name require 'spree/testing_support/extension_rake' namespace :extension do directory ENV['DUMMY_PATH'] do Rake::Task['extension:test_app'] # We need to go back to the gem root since extension:test_app changes # the working directory to be the dummy app. cd root end end end def install_rspec_task namespace :extension do require 'rspec/core/rake_task' ::RSpec::Core::RakeTask.new(:specs, [] => FileList[ENV['DUMMY_PATH']]) do |t| # Ref: https://circleci.com/docs/2.0/configuration-reference#store_test_results # Ref: https://github.com/solidusio/circleci-orbs-extensions#test-results-rspec if ENV['TEST_RESULTS_PATH'] t.rspec_opts = "--format progress " \ "--format RspecJunitFormatter --out #{ENV['TEST_RESULTS_PATH']}" end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solidus_dev_support-0.3.0 | lib/solidus_dev_support/rake_tasks.rb |
solidus_dev_support-0.2.0 | lib/solidus_dev_support/rake_tasks.rb |