Sha256: e5dd7352f1aa780697c0748bc241628262a2635e33f2bf166878190ae4c559ed

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
require 'albacore/sqlcmd'
require 'rake/sqlcmdtask'
require 'tasklib_patch'

describe Albacore::SQLCmdTask, "when running" do
  before :all do
    task = Albacore::SQLCmdTask.new(:sqlcmd) do |t|
      @yielded_object = t
    end
    task.extend(TasklibPatch)
    Rake::Task[:sqlcmd].invoke
  end
  
  it "should yield the sqlcmd api" do
    @yielded_object.kind_of?(SQLCmd).should == true 
  end
end

describe Albacore::SQLCmdTask, "when execution fails" do
  before :all do
    @task = Albacore::SQLCmdTask.new(:failingtask)
    @task.extend(TasklibPatch)
    @task.fail
    Rake::Task["failingtask"].invoke
  end
  
  it "should fail the rake task" do
    @task.task_failed.should be_true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-0.1.1 spec/sqlcmdtask_spec.rb
albacore-0.1.0 spec/sqlcmdtask_spec.rb