Class: AlpacaBuildTool::TestManager

Inherits:
Object
  • Object
show all
Defined in:
lib/alpacabuildtool/managers/test_manager.rb

Overview

TestManager provides methods to test *.sln solutions

Instance Method Summary collapse

Constructor Details

#initialize(solution) ⇒ TestManager

Creates an instance

solution

solution to be used to configure test manager


13
14
15
16
17
# File 'lib/alpacabuildtool/managers/test_manager.rb', line 13

def initialize(solution)
  package_manager = PackageManager.new(solution)
  @test_tool = package_manager.get('NUnit')
  @coverage_tool = package_manager.get('OpenCover', @test_tool)
end

Instance Method Details

#test(test_projects, coverage = false, debug = false) ⇒ Object

Test list of projects

test_projects

list of projects with tests

coverage

set to run coverage

debug

set to run tests with debug configuration


25
26
27
28
29
30
31
32
33
# File 'lib/alpacabuildtool/managers/test_manager.rb', line 25

def test(test_projects, coverage = false, debug = false)
  test_projects.each do |project|
    if coverage
      @coverage_tool.call { |tool| tool.test(project.file, debug) }
    else
      @test_tool.test(project.file, debug)
    end
  end
end