Sha256: ae2cce53c01d161a795af0fa44479c4642397e64bc1ea82aefe67b9cae8fd99e

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

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

describe "when running" do
  before :each do
    expandtemplates :expandtemplates do |t|
      t.extend(FailPatch)
      @yielded_object = t
    end
    Rake::Task[:expandtemplates].invoke
  end
  
  it "should yield the expand template api" do
    @yielded_object.kind_of?(ExpandTemplates).should == true 
  end
end

describe "when execution fails" do
  before :each do
  	expandtemplates :expand_fail do |t|
      t.extend(FailPatch)
      t.fail
    end
    Rake::Task[:expand_fail].invoke
  end
  
  it "should fail the rake task" do
    $task_failed.should be_true
  end
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

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