class Sloe::Expectations::Junos::HaveAllBgpPeersAs

Public Instance Methods

failure_message() click to toggle source
# File lib/sloe/expectations.rb, line 113
def failure_message
  @no_match
end
match(actual) click to toggle source
# File lib/sloe/expectations.rb, line 104
def match(actual)
  @no_match = actual.xpath('//bgp-peer').each do |peer|
    if peer.xpath('peer-state').text != @state
      "#{peer.xpath('peer-address').text} state is #{peer.xpath('peer-state').text}"
    end
  end
  @no_match.size == 0
end