Sha256: 3aa14e8b2978494919be079f71094662338c1d9968208d33c5922bed77f32723
Contents?: true
Size: 746 Bytes
Versions: 9
Compression:
Stored size: 746 Bytes
Contents
def be_a_valid_ssml_document SSMLMatcher.new end class SSMLMatcher attr_reader :subject def subject=(s) if s.is_a? Nokogiri::XML::Document @subject = s else doc = Nokogiri::XML::Document.new doc << s @subject = doc end end def failure_message " expected #{subject} to be a valid SSML document\n#{errors}" end def negative_failure_message " expected #{subject} not to be a valid SSML document" end def description "to be a valid SSML document" end def matches?(s) self.subject = s SSML_SCHEMA.valid? subject end def does_not_match?(s) !matches? s end private def errors SSML_SCHEMA.validate(subject).map(&:message).join "\n" end end
Version data entries
9 entries across 9 versions & 1 rubygems