Sha256: 0b8e1964c809b476777e72b061c19e66de0007dedcbc69ef211248acbc0bfc26

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

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

class RunCommandObject
  include YAMLConfig
  include RunCommand

  def execute
    @require_valid_command = false
    result = run_command "Run Command Test Object"
  end
end

describe "when running two instances of a command line task" do
  before :all do
    create_task :run_command_task, Proc.new { RunCommandObject.new } do |ex|
      ex.execute
    end

  	run_command_task :one do |x|
      x.extend(SystemPatch)
      x.path_to_command = "set"
      x.parameters "_albacore_test = test_one"
      @one = x
  	end

    run_command_task :two do |x|
      x.extend(SystemPatch)
      x.path_to_command = "set"
      x.parameters "_another_albacore_test = test_two"
      @two = x
    end
    
    Rake::Task[:one].invoke
    Rake::Task[:two].invoke
  end
  
  it "should only pass the parameters specified to the first command" do
    @one.system_command.should == "\"set\" _albacore_test = test_one"
  end
  
  it "should only pass the parameters specified to the second command" do
    @two.system_command.should == "\"set\" _another_albacore_test = test_two"
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-0.1.5 spec/runcommand_spec.rb
albacore-0.1.4 spec/runcommand_spec.rb