Sha256: 0a36477c4eecee5364f9441fe975b0f92e956a2fa8e0c4f040b5b53080c65217

Contents?: true

Size: 1021 Bytes

Versions: 5

Compression:

Stored size: 1021 Bytes

Contents

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

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

describe "when execution fails" do
  before :all do
    nunit :nunit_fail do |t|
      t.extend(FailPatch)
      t.fail
    end
    Rake::Task[:nunit_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
    nunit :nunittask_withargs, [:arg1] do |t, args|
      t.extend(FailPatch)
      @args = args
  	end
    Rake::Task[:nunittask_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/nunittask_spec.rb
albacore-0.1.5 spec/nunittask_spec.rb
albacore-0.1.4 spec/nunittask_spec.rb
albacore-0.1.3 spec/nunittask_spec.rb
albacore-0.1.2 spec/nunittask_spec.rb