Sha256: 392fb71ab375c261dbd44576cd338d1a62ad47d643d1b434a127d2453a40881f

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

require '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("\"#{File.expand_path(@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

10 entries across 10 versions & 1 rubygems

Version Path
albacore-0.3.6 spec/exec_spec.rb
albacore-1.0.0.rc.2 spec/exec_spec.rb
albacore-1.0.0.rc.1 spec/exec_spec.rb
albacore-0.3.5 spec/exec_spec.rb
albacore-0.3.4 spec/exec_spec.rb
albacore-0.3.3 spec/exec_spec.rb
albacore-0.3.2 spec/exec_spec.rb
albacore-0.3.1 spec/exec_spec.rb
albacore-0.3.0 spec/exec_spec.rb
albacore-0.2.6 spec/exec_spec.rb