Sha256: 5466c5baa5544426347f00a2d130b41c4a7261f9f876e4c2b4d002cf481e0320

Contents?: true

Size: 1.34 KB

Versions: 4

Compression:

Stored size: 1.34 KB

Contents

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

describe "Sensors" do

  attr_accessor :provider
  before :each do
    user = ENV["ipmiuser"]
    pass = ENV["ipmipass"]
    host = ENV["ipmihost"]
    provider = ENV["ipmiprovider"]
    @conn = Rubyipmi.connect(user, pass, host, provider)

  end

  it "test get all sensors" do
    @conn.sensors.list.count.should be > 1
  end

  it "test should refresh data" do
    old = @conn.sensors.list
    @conn.sensors.refresh
    new = @conn.sensors.list
    old.should_not equal(new)
  end

  it "test should return count greater than 1" do
    @conn.sensors.count.should be > 1
  end

  it "test should return names" do
    @conn.sensors.names.count.should be > 1
  end

  it "test should return list of fans" do
    @conn.sensors.fanlist.count.should be > 1
  end

  it "test should return list of temps" do
    @conn.sensors.templist.count.should be > 1
  end

  it "test should create new Sensor" do
    if provider == "ipmitool"
      Rubyipmi::Ipmitool::Sensor.new("fakesensor").should_not be nil
    else
      Rubyipmi::Freeipmi::Sensor.new("fakesensor").should_not be nil
    end
  end

  it "test missing method with known good method" do
    @conn.sensors.fan_1.should_not be nil
  end

  it "test missing method with known bad method" do
    expect {@conn.sensors.blah}.to raise_exception
  end


end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubyipmi-0.6.0 spec/sensor_spec.rb
rubyipmi-0.5.1 spec/sensor_spec.rb
rubyipmi-0.5.0 spec/sensor_spec.rb
rubyipmi-0.4.0 spec/sensor_spec.rb