Sha256: 05a0c2bd533548ccb2c8b1309e8369396b2864a3e8479bb7611403065d7c9b9d

Contents?: true

Size: 761 Bytes

Versions: 2

Compression:

Stored size: 761 Bytes

Contents

require 'generative'
require 'rspec/core/rake_task'

module Generative
  class RakeTask < RSpec::Core::RakeTask
    def initialize(*args, &task_block)
      super

      self.name = :generative if name == :spec

      desc "Run Generative specs" unless Rake.application.last_description

      options = %w[
        --require generative
        --format Generative::Formatter
        --tag generative
      ]

      self.rspec_opts = options.join(' ')

      task name, *args do |_, task_args|
        RakeFileUtils.send(:verbose, verbose) do
          ENV['GENERATIVE_COUNT'] ||= Generative::DEFAULT_COUNT
          task_block.call(*[self, task_args].slice(0, task_block.arity)) if task_block
          run_task verbose
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
generative-0.2.5 lib/generative/rake_task.rb
generative-0.2.4 lib/generative/rake_task.rb