Sha256: 8268b43da94cb7d4e3dd8af7c5b14a1ca17eb6342af17fcd9176ebf72500860b

Contents?: true

Size: 1023 Bytes

Versions: 5

Compression:

Stored size: 1023 Bytes

Contents

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

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

describe "when execution fails" do
  before :all do
    mspec :mspec_fail do |t|
      t.extend(FailPatch)
      t.fail
    end
    Rake::Task[:mspec_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
    mspec :mspectask_withargs, [:arg1] do |t, args|
      t.extend(FailPatch)
      @args = args
  	end
    Rake::Task[:mspectask_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/mspectask_spec.rb
albacore-0.1.5 spec/mspectask_spec.rb
albacore-0.1.4 spec/mspectask_spec.rb
albacore-0.1.3 spec/mspectask_spec.rb
albacore-0.1.2 spec/mspectask_spec.rb