Sha256: 676ddb88c0e010fe2fc4a6b538cc71946aa977ea998a4c4628e2dc4830ca4574

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

begin
  require 'rspec/core/rake_task'

  RSpec::Core::RakeTask.new(:"bake:rspec") do |t|
    t.verbose = false
    RakeNBake::AssistantBaker.log_step 'Running specs'
  end

  RSPEC_SUBDIRS = %w[integration features requests]

  RSPEC_SUBDIRS.each do |subdir|
    RSpec::Core::RakeTask.new(:"bake:rspec:#{subdir}") do |t|
      t.verbose = false
      t.pattern = "spec/#{subdir}/**/*_spec.rb"
      RakeNBake::AssistantBaker.log_step "Running #{subdir} specs"
    end
  end

  RSpec::Core::RakeTask.new(:"bake:rspec:unit") do |t|
    t.verbose = false
    file_list = FileList['spec/**/*_spec.rb']
    RSPEC_SUBDIRS.each do |subdir|
      file_list = file_list.exclude "spec/#{subdir}/**/*_spec.rb"
    end
    t.pattern = file_list
    RakeNBake::AssistantBaker.log_step 'Running unit specs'
  end

  RSpec::Core::RakeTask.new(:"bake:rspec:tag", :tag) do |t, task_args|
    t.verbose = false
    t.rspec_opts = "--tag #{task_args[:tag]}"
    RakeNBake::AssistantBaker.log_step "Running specs tagged #{task_args[:tag]}"
  end

  RSpec::Core::RakeTask.new(:"bake:rspec_test_prepare" => :"test:prepare") do |t|
    t.verbose = false
  end

rescue LoadError

  namespace :bake do
    %w[rspec rspec_test_prepare].map(&:to_sym).each do |t|
      desc 'RSpec rake tasks are not available (gem not installed)'
      task t do
        RakeNBake::AssistantBaker.log_missing_gem 'rspec', 'RSpec'
        abort
      end
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rake-n-bake-1.4.1 tasks/rspec.rake
rake-n-bake-1.4.0 tasks/rspec.rake
rake-n-bake-1.3.3 tasks/rspec.rake
rake-n-bake-1.3.1 tasks/rspec.rake
rake-n-bake-1.3.0 tasks/rspec.rake
rake-n-bake-1.2.0 tasks/rspec.rake
rake-n-bake-1.1.5 tasks/rspec.rake