Sha256: ef26f4a2a535d5a5011afa814ea6ebe46dbd17ec33ee4c79e43b952afd34bece

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
require 'albacore/ndepend'
require 'albacore/msbuild'

describe "when executing Ndepend console" do
  before :all do
    @msbuild = MSBuild.new
    @msbuild.properties = {:configuration => :Debug}
    @msbuild.targets = [:Clean, :Build]
    @msbuild.solution = "spec/support/TestSolution/TestSolution.sln"
    @msbuild.build
  end
  before :each do
    @ndepend = NDepend.new
    @ndepend.log_device = StringIO.new
    @ndepend.project_file = "spec/support/TestSolution/NDependProject.xml"
    @ndepend.path_to_command = "spec/support/tools/Ndepend-v2.12/NDepend.Console.exe"

    @logger = StringIO.new
    @ndepend.log_device = @logger
    @log_data = @logger.string
    @ndepend.log_level = :verbose


  end
  it "should execute NdependConsole.exe"do
    @ndepend.run

    @log_data.should include("NDepend.Console.exe" )
  end

  it "should include the Ndepend project file" do
    @ndepend.run
    @log_data.should include("NDependProject.xml")
  end

  it "should fail when the project file is not given" do
    @ndepend.project_file = nil
    @ndepend.extend(FailPatch)
    @ndepend.run
    $task_failed.should be_true
  end

  it "should accept other parameters" do
    expected_params = "/ViewReport /Silent /Help"
    @ndepend.parameters expected_params
    @ndepend.extend(FailPatch)
    @ndepend.run
    @log_data.should include(expected_params)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
albacore-0.1.5 spec/ndepend_spec.rb
albacore-0.1.4 spec/ndepend_spec.rb
albacore-0.1.3 spec/ndepend_spec.rb
albacore-0.1.2 spec/ndepend_spec.rb