Sha256: 560a4bb3a5fea1dee67aab2bc26da1245126ce1552597f13291a77b819675de3

Contents?: true

Size: 943 Bytes

Versions: 4

Compression:

Stored size: 943 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe DRbQS::Task do
  it "should not set hook" do
    task = DRbQS::Task.new([1, 2, 3], :size)
    task.hook.should be_nil
  end

  it "should set hook" do
    task = DRbQS::Task.new([1, 2, 3], :size) do |server, ret|
      p ret
    end
    task.hook.should be_an_instance_of Proc
  end

  it "should have same targets" do
    task1 = DRbQS::Task.new([1, 2, 3], :concat, [3, 4, 5])
    task2 = DRbQS::Task.new([1, 2, 3], :concat, [3, 4, 5])
    task1.same_target?(task2).should be_true
  end
end

describe DRbQS::CommandExecute do
  it "should execute command" do
    cmd_exec = DRbQS::CommandExecute.new('ls > /dev/null')
    cmd_exec.exec.should == 0
  end

  it "should enqueue files" do
    DRbQS::FileTransfer.should_receive(:enqueue).exactly(2)
    cmd_exec = DRbQS::CommandExecute.new('ls > /dev/null', :transfer => ['hello', 'world'])
    cmd_exec.exec
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
drbqs-0.0.12 spec/task_spec.rb
drbqs-0.0.11 spec/task_spec.rb
drbqs-0.0.10 spec/task_spec.rb
drbqs-0.0.9 spec/task_spec.rb