Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Matchers
- class Pixel
- def initialize(type, attrs)
- @type, @attrs = type, attrs
- end
- def matches?(actual)
- tag = Nokogiri::XML(actual).children.first
- (tag.name == @type) and @attrs.all? do |element|
- k,v = *element
- tag.attributes[k.to_s].value == v.to_s
- end
- end
- def failure_message
- "DOESN'T WORK"
- end
- def negative_failure_message
- "DOESN'T WORK"
- end
- end
- def match_pixel_tag(type, attrs)
- Pixel.new(type, attrs)
- end
- end
Add Comment
Please, Sign In to add comment