Sha256: ef4346289e63e2a52e109254983902334e5767e394bf460614d4e1c49e2bb113

Contents?: true

Size: 689 Bytes

Versions: 16

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true

require_relative '../../commands'

RubyLeiningen::Commands.define_custom_command('eftest') do |config, opts|
  only = opts[:only] ? [":only #{opts[:only]}"] : []
  specific = (opts[:test_selectors] || [])
             .map { |m| m.is_a?(Symbol) ? ":#{m}" : m.to_s }
  all = [':all']

  test_selectors =
    if only.any?
      only
    elsif specific.any?
      specific
    else
      all
    end

  namespaces = opts[:namespaces] || []
  files = opts[:files] || []

  arguments = namespaces.concat(files).concat(test_selectors)

  config.on_command_builder do |command|
    arguments.inject(command) do |c, arg|
      c.with_argument(arg)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_leiningen-0.30.0.pre.2 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.30.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.29.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.7 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.6 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.5 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.4 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.3 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.2 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.28.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.27.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.26.0.pre.2 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.26.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.25.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.24.0.pre.8 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.24.0.pre.7 lib/ruby_leiningen/commands/plugins/eftest.rb