Sha256: 658f6d063bc37279328be950da890faf8f2741769a1e552c997f9e9f62047495

Contents?: true

Size: 998 Bytes

Versions: 6

Compression:

Stored size: 998 Bytes

Contents

require 'rake/tasklib'

module Rake::Funnel::Tasks
  class NUnit < Rake::TaskLib
    attr_accessor :name, :files, :args

    def initialize(name = :test)
      @name = name
      @args = {}
      @files = %w(build/specs/**/*.dll build/specs/**/*.exe)

      yield self if block_given?
      define
    end

    def nunit
      @_nunit || 'nunit-console.exe'
    end

    def nunit=(value)
      @_nunit = value
    end

    private
    def define
      desc "Test #{test_assemblies.all_or_default.join(', ')}"
      task name do
        Rake::Funnel::Integration::TeamCity::NUnitPlugin.setup(nunit)

        cmd = [
          *Rake::Funnel::Support::Mono.invocation(nunit),
          *test_assemblies.all,
          *Rake::Funnel::Support::Mapper.new(:NUnit).map(args)
        ]

        sh(*cmd)
      end

      self
    end

    def test_assemblies
      Rake::Funnel::Support::Finder.new(files, self, 'No test assemblies found.')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rake-funnel-0.0.6.pre lib/rake/funnel/tasks/nunit.rb
rake-funnel-0.0.5.pre lib/rake/funnel/tasks/nunit.rb
rake-funnel-0.0.4.pre lib/rake/funnel/tasks/nunit.rb
rake-funnel-0.0.3.pre lib/rake/funnel/tasks/nunit.rb
rake-funnel-0.0.2.pre lib/rake/funnel/tasks/nunit.rb
rake-funnel-0.0.1.pre lib/rake/funnel/tasks/nunit.rb