Sha256: b2708f1b9036be459b5e29bc81f407aea4c24a2825ab2be49861e2fca57cf286

Contents?: true

Size: 617 Bytes

Versions: 12

Compression:

Stored size: 617 Bytes

Contents

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}" }
  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

12 entries across 12 versions & 1 rubygems

Version Path
ruby_leiningen-0.12.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.11.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.10.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.9.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.8.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.7.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.6.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.5.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.4.0.pre.1 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.3.0 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.2.0.pre.2 lib/ruby_leiningen/commands/plugins/eftest.rb
ruby_leiningen-0.1.0 lib/ruby_leiningen/commands/plugins/eftest.rb