Sha256: cfb6e2db9f25999e11d9d463a4e45ca21b112ad008baa448e2db2a7ce2224fd5

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'

describe LinuxAdmin::Common do
  before do
    class TestClass
      extend LinuxAdmin::Common
    end
  end

  after do
    Object.send(:remove_const, :TestClass)
  end

  subject { TestClass }

  context "#cmd" do
    it "looks up local command from id" do
      d = double(LinuxAdmin::Distros::Distro)
      d.class::COMMANDS = {:sh => '/bin/sh'}
      LinuxAdmin::Distros::Distro.should_receive(:local).and_return(d)
      subject.cmd(:sh).should == '/bin/sh'
    end
  end

  it "#run" do
    AwesomeSpawn.should_receive(:run).with("echo", nil => "test")
    subject.run("echo", nil => "test")
  end

  it "#run!" do
    AwesomeSpawn.should_receive(:run!).with("echo", nil => "test")
    subject.run!("echo", nil => "test")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
linux_admin-0.8.1 spec/common_spec.rb