spec/methods_spec.rb in sloe-0.5.1 vs spec/methods_spec.rb in sloe-0.5.3

- old
+ new

@@ -5,12 +5,12 @@ before(:all) do @jnx_mibs = Dir.glob("./mibs/JUNIPER-*.yaml").map { |f| File.basename(f, '.yaml') } @args = { :target => 'capella', - :username => 'dgethings', - :password => 'mcisamilf', + :username => 'netconf', + :password => 'netconf', :mib_dir => './mibs', :mib_modules => ["SNMPv2-SMI", "SNMPv2-MIB", "IF-MIB", "IP-MIB", "TCP-MIB", "UDP-MIB"].concat(@jnx_mibs) } @dut = Sloe::Junos.new(@args) @@ -42,11 +42,11 @@ @dut.snmp.get_value('jnxBoxDescr.0').should =~ /^Juniper/ end end context "NETCONF API" do - it "rpc.get_interface_information() functioons without error" do + it "rpc.get_interface_information() functions without error" do lambda { @dut.rpc.get_interface_information() }.should_not raise_error end it "rpc.get_ospf_neighbor_information() functions without error" do lambda { @dut.rpc.get_ospf_neighbor_information() }.should_not raise_error end @@ -64,13 +64,18 @@ File.delete('/var/tmp/test') end end context "CLI API" do - it "cli.('show version') functions without error" do + it "cli('show version') functions without error" do lambda { @dut.cli("show version") }.should_not raise_error end - it "cli.('show version') contains OS information" do - @dut.cli("show version").text.should =~ /JUNOS Base OS/ + it "cli('show version') contains OS information" do + @dut.cli("show version").should be_a(String) + @dut.cli("show version").should =~ /JUNOS Base OS/ + end + it "cli('show version', :foo => 'bar') still contains OS information" do + @dut.cli("show version", :foo => 'bar').should be_a(String) + @dut.cli("show version", :foo => 'bar').should =~ /JUNOS Base OS/ end end end \ No newline at end of file