class Sloe::Expectations::Junos::HavePimNeighborOnAllInterfaces

Public Instance Methods

failure_message_for_should() click to toggle source
# File lib/sloe/expectations.rb, line 128
def failure_message_for_should
  @pim_int_without_neighbor
end
match(actual) click to toggle source
# File lib/sloe/expectations.rb, line 119
def match(actual)
  @pim_int_without_neighbor = actual.xpath('//pim-interface[contains(pim-interface-name,"ae")]').map do |int|
    if int.xpath('neighbor-count').text.to_i == 0
      "#{int.xpath('pim-interface-name').text} has no neighbors"
    end
  end
  @pim_int_without_neighbor.size == 0
end