Sha256: 83a244513e80e85a3294077127b8aa862845f5817fd6247349197c73e068a5a9

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

require 'spec_helper'

describe Sloe do
  let(:login) { {target: 'crtj-0dc1-0001', username: 'netadmin', password: 'pass123'} }
  context "invoked with block" do
    it "calls Netconf RPC" do
      hostname = ''
      Sloe::Device.new(login) { |dut| 
        hostname = dut.rpc.get_system_information.xpath('//host-name').text
      }
      expect(hostname).to include login[:target]
    end

    it "calls SNMP RPC" do
      hostname = ''
      Sloe::Device.new (login) { |dut| 
        hostname = dut.snmp.get_value( 'sysName.0' ).to_s
      }
      expect(hostname).to include login[:target]
    end
  end

  context "Junos extensions" do
    it "Sloe::Junos responds to Junos specific RPCs" do
      expect( Sloe::Junos.new(login).rpc ).to respond_to(:lock_configuration)
    end
    it "Sloe::Device does not respond to Junos specific RPCs" do
      expect( Sloe::Device.new(login).rpc ).to_not respond_to(:lock_configuration)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sloe-0.8.6 spec/blocks_spec.rb