Sha256: 0c4b15fc4bbf420a94a3b8ac4e440e2d1bad630fc02a471518ac246df7d7f856

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
require 'albacore/msbuild'
require 'rake/msbuildtask'
require 'fail_patch'

describe "when running" do
  before :all do
    msbuild :msbuild do |t|
      t.extend(FailPatch)
      @yielded_object = t
    end
    Rake::Task[:msbuild].invoke
  end
  
  it "should yield the msbuild api" do
    @yielded_object.kind_of?(MSBuild).should == true 
  end
end

describe "when execution fails" do
  before :all do
    msbuild :msbuild_fail do |t|
      t.extend(FailPatch)
      t.fail
    end
    Rake::Task[:msbuild_fail].invoke
  end
  
  it "should fail the rake task" do
    $task_failed.should == true
  end
end

describe "when task args are used" do
  before :all do
    msbuild :msbuildtask_withargs, [:arg1] do |t, args|
      t.extend(FailPatch)
      @args = args
  	end
    Rake::Task[:msbuildtask_withargs].invoke("test")
  end
  
  it "should provide the task args" do
    @args.arg1.should == "test"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
albacore-0.2.0.preview1 spec/msbuildtask_spec.rb
albacore-0.1.5 spec/msbuildtask_spec.rb
albacore-0.1.4 spec/msbuildtask_spec.rb
albacore-0.1.3 spec/msbuildtask_spec.rb
albacore-0.1.2 spec/msbuildtask_spec.rb