Sha256: af1074ac3ab56e8bccb98726789ff9f63e2bfc6157761935944c5feae20bfd60

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require 'rubygems'
require 'markup_validity'
require 'test/helper'

module Spec
  module Matchers
    extend MarkupValidity::TestHelper
    describe "[actual.should] be_xhtml_transitional" do
      it "is transitional xhtml" do
        Matchers.valid_document.should be_xhtml_transitional
      end

      it "is xhtml" do
        Matchers.valid_document.should be_xhtml
      end

      it "is strict xhtml" do
        Matchers.valid_document.should be_xhtml_strict
      end

      it "is not transitional xhtml" do
        Matchers.invalid_document.should_not be_xhtml_transitional
      end

      it "is not strict xhtml" do
        Matchers.invalid_document.should_not be_xhtml_strict
      end

      XSD = File.read(
        File.expand_path(
          File.join(File.dirname(__FILE__),'..','test','assets','shipment.xsd')
        )
      )
      XML = File.read(
        File.join(File.dirname(__FILE__), '..','test', 'assets', 'order.xml')
      )

      it "is valid given spec" do
        XML.should be_valid_with_schema XSD
      end

      it "is not valid given spec" do
        XML.gsub(/<name>[^<]*<\/name>/, '').should_not be_valid_with_schema XSD
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
markup_validity-1.0.0 spec/matcher_spec.rb