spec/integration/connection_spec.rb in rubyipmi-0.8.1 vs spec/integration/connection_spec.rb in rubyipmi-0.9.0

- old
+ new

@@ -1,35 +1,36 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') +require 'spec_helper' + describe "Connection" do before :each do user ||= ENV["ipmiuser"] || "admin" pass ||= ENV["ipmipass"] || "password" - host ||= ENV["ipmihost"] || "10.0.1.16" + host ||= ENV["ipmihost"] || "192.168.1.16" provider ||= ENV["ipmiprovider"] || "ipmitool" @conn = Rubyipmi.connect(user, pass, host, provider) - end it "creates a new object" do - @conn.should_not be_nil - + expect(@conn).to be_truthy end it 'creates a bmc object' do - @conn.bmc.should_not be_nil - puts "Last Call: #{@conn.bmc.lastcall.inspect}" - + expect(@conn.bmc).to be_truthy end it 'creates a chassis object' do - @conn.chassis.should_not be_nil - puts "Last Call: #{@conn.chassis.lastcall.inspect}" + expect(@conn.chassis).to be_truthy + end + it 'can test the connection' do + expect(@conn.connection_works?).to eq true end + it 'can get diag info' do + expect(@conn.get_diag.keys).to eq([:provider, :frus, :sensors, :bmc_info, :version]) + end -end -#it "raises an error if host is unreachable" do -# conn = Freeipmi.connect("admin", "creative", "192.168.1.181") -# -#end + it 'can get version info' do + expect(@conn.bmc.version).to match(/[\d\.]{3,4}/) + end +end \ No newline at end of file