Sha256: fd417f8614e45cf86f4770e25561a394b9927a560791df274f70b062d9a0e12f

Contents?: true

Size: 1.86 KB

Versions: 11

Compression:

Stored size: 1.86 KB

Contents

# frozen_string_literal: true

require 'bundler/gem_tasks'

begin
  require 'rspec'
  require 'rspec/core'
  require 'rspec/core/rake_task'
  require 'octorelease' unless ENV['CI']
  require 'parallel'
  require 'rubocop/rake_task'
rescue LoadError
end

require 'awspec'

types = Awspec::Helper::Type::TYPES.map do |type|
  "spec:#{type}"
end

if defined?(RSpec)
  task spec: 'spec:all'
  namespace :spec do
    task :parallel do
      Parallel.each(types.concat([
                                   'spec:account',
                                   'spec:core',
                                   'spec:generator_spec',
                                   'spec:generator_doc',
                                   'spec:helper'
                                 ])) do |t|
        puts ''
        Rake::Task[t].execute
      end
    end
    task all: ['spec:type',
               'spec:account',
               'spec:core',
               'spec:generator_spec',
               'spec:generator_doc',
               'spec:helper']

    task type: types

    Awspec::Helper::Type::TYPES.map do |type|
      RSpec::Core::RakeTask.new(type) do |t|
        t.pattern = "spec/type/#{type}_spec.rb"
      end
    end

    RSpec::Core::RakeTask.new(:account) do |t|
      t.pattern = 'spec/type/account_spec.rb'
    end

    RSpec::Core::RakeTask.new(:core) do |t|
      t.pattern = 'spec/core/*_spec.rb'
    end

    RSpec::Core::RakeTask.new(:generator_spec) do |t|
      t.pattern = 'spec/generator/spec/*_spec.rb'
    end

    RSpec::Core::RakeTask.new(:generator_doc) do |t|
      t.pattern = 'spec/generator/doc/*_spec.rb'
    end

    RSpec::Core::RakeTask.new(:helper) do |t|
      t.pattern = 'spec/lib/awspec/helper/*_spec.rb'
    end

    RuboCop::RakeTask.new
  end
end

task :generate_docs do
  docs = Awspec::Generator::Doc::Type.generate_doc
  File.write('doc/resource_types.md', "#{docs}\n")
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
awspec-1.30.0 Rakefile
awspec-1.29.3 Rakefile
awspec-1.29.2 Rakefile
awspec-1.29.1 Rakefile
awspec-1.29.0 Rakefile
awspec-1.28.2 Rakefile
awspec-1.28.1 Rakefile
awspec-1.28.0 Rakefile
awspec-1.27.1 Rakefile
awspec-1.27.0 Rakefile
awspec-1.26.0 Rakefile