Sha256: c068dfea9d4760ae4f67c788dfb521c74131e0dfa85dd8e7c326e6c1235c33fa

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require File.join(File.dirname(__FILE__), 'support', 'spec_helper')
require 'albacore/exec'

describe Exec, "when executing a command with parameters" do
  before :all do
    @nunit = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')

    @cmd = Exec.new
    @cmd.log_level = :verbose
    @cmd.extend(SystemPatch)
    @cmd.extend(FailPatch)
    @cmd.command = @nunit
    @cmd.parameters "--help"
    @cmd.execute
  end
  
  it "should run the command with the parameters" do
    @cmd.system_command.should include("\"#{@nunit}\" --help")
  end
  
  it "should specify the parameters only once" do
  	@cmd.system_command.scan(/--help/).length.should be(1)
  end
  
  it "should not fail" do
    $task_failed.should be_false
  end
end

describe Exec, "when providing configuration" do 
  let :exec do
    Albacore.configure do |config|
      config.exec do |exe|
        exe.command = "foo.exe"
        exe.parameters = ["bar", "baz"]
      end
    end
    exec = Exec.new
  end

  it "should use the configuration" do
    exec.command.should == "foo.exe"
    exec.parameters.should == ["bar", "baz"]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
albacore-0.2.0.preview1 spec/exec_spec.rb