Sha256: c2efac60c276e4f4eb5659a0b388976df6a0f65d6bcbbf692fd773f24fd89d41

Contents?: true

Size: 1.24 KB

Versions: 17

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_leiningen'
require 'ruby_leiningen/plugins'

require_relative '../mixins/directoried'

module RakeLeiningen
  module Tasks
    class Test < RakeFactory::Task
      include Mixins::Directoried

      default_name :test
      default_description(RakeFactory::DynamicValue.new do |t|
        "Run #{t.type ? "all #{t.type}" : 'all'} tests."
      end)
      default_prerequisites(RakeFactory::DynamicValue.new do |t|
        t.ensure_task_name ? [t.ensure_task_name] : []
      end)

      parameter :type

      parameter :only
      parameter :test_selectors
      parameter :namespaces
      parameter :files
      parameter :profile
      parameter :environment

      parameter :directory, default: '.'

      parameter :ensure_task_name, default: 'leiningen:ensure'

      action do |t|
        $stdout.puts "Running #{t.type ? "all #{t.type}" : 'all'} tests..."

        in_directory(t.directory) do
          RubyLeiningen.eftest(
            only: t.only,
            test_selectors: t.test_selectors,
            namespaces: t.namespaces,
            files: t.files,
            profile: t.profile,
            environment: t.environment
          )
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rake_leiningen-0.39.0.pre.2 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.39.0.pre.1 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.38.0 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.7 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.6 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.5 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.4 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.3 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.2 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.37.0.pre.1 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.36.0 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.35.0.pre.2 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.35.0.pre.1 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.34.0 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.33.0.pre.5 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.33.0.pre.4 lib/rake_leiningen/tasks/test.rb
rake_leiningen-0.33.0.pre.3 lib/rake_leiningen/tasks/test.rb