Sha256: cbbc8e84fdc3576dbf8605d26fcb9144ce32ca756f7e297608602793219d1b47

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

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

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

describe "when execution fails" do
  before :all do
    ncoverreport :ncoverreport_fail do |t|
      t.extend(FailPatch)
      t.fail
    end
    Rake::Task[:ncoverreport_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
    ncoverreport :ncoverreporttask_withargs, [:arg1] do |t, args|
      t.extend(FailPatch)
      @args = args
  	end
    Rake::Task[:ncoverreporttask_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/ncoverreporttask_spec.rb
albacore-0.1.5 spec/ncoverreporttask_spec.rb
albacore-0.1.4 spec/ncoverreporttask_spec.rb
albacore-0.1.3 spec/ncoverreporttask_spec.rb
albacore-0.1.2 spec/ncoverreporttask_spec.rb