Sha256: 435d83c84a4c921239d85c678801c6d1deb28aeda09c499d6fcd4ccbf1a0058c

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'albacore/support/albacore_helper'

class NUnitTestRunner
  extend AttrMethods
  include RunCommand
  include YAMLConfig
  
  attr_array :assemblies, :options
  
  def initialize(path_to_command='')
    @path_to_command = path_to_command
    @options=[]
    @assemblies=[]
    super()
  end
  
  def get_command_line
    command_params = []
    command_params << @path_to_command
    command_params << get_command_parameters
    commandline = command_params.join(" ")
    @logger.debug "Build NUnit Test Runner Command Line: " + commandline
    commandline
  end
  
  def get_command_parameters
    command_params = []
    command_params << @options.join(" ") unless @options.nil?
    command_params << @assemblies.map{|asm| "\"#{asm}\""}.join(' ') unless @assemblies.nil?
    command_params
  end
  
  def execute()
    command_params = get_command_parameters
    result = run_command "NUnit", command_params.join(" ")
    
    failure_message = 'NUnit Failed. See Build Log For Detail'
    fail_with_message failure_message if !result
  end  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
albacore-0.1.5 lib/albacore/nunittestrunner.rb
albacore-0.1.4 lib/albacore/nunittestrunner.rb
albacore-0.1.3 lib/albacore/nunittestrunner.rb
albacore-0.1.2 lib/albacore/nunittestrunner.rb