Sha256: 251d6685fc7fb74325d1f5697667ce82c936cea06132491dd6a7e3e75db4e39b

Contents?: true

Size: 958 Bytes

Versions: 2

Compression:

Stored size: 958 Bytes

Contents

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

describe :Rubyipmi do


  before :each do

  end

  it 'is provider installed should return ipmitool true' do
    Rubyipmi.stub(:locate_command).with('ipmitool').and_return('/usr/local/bin/ipmitool')
    Rubyipmi.is_provider_installed?('ipmitool').should be_true
  end

  it 'is locate command should return command in /usr/local/bin' do
    Rubyipmi.stub(:locate_command).with('ipmitool').and_return('/usr/local/bin/ipmitool')
    Rubyipmi.locate_command('ipmitool').should eq('/usr/local/bin/ipmitool')
  end

  it 'is provider installed should return freeipmi true' do
    Rubyipmi.stub(:locate_command).with('ipmipower').and_return('/usr/local/bin/ipmipower')
    Rubyipmi.is_provider_installed?('freeipmi').should be_true
  end

  it 'is provider installed should return error with ipmitool' do
    expect{Rubyipmi.is_provider_installed?('bad_provider')}.to raise_error
  end

end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubyipmi-0.8.1 spec/unit/rubyipmi_spec.rb
rubyipmi-0.7.0 spec/unit/rubyipmi_spec.rb