Sha256: b3088553dcbb41397e2598f2ca17aa0da6355634d605b22715f0ad06ffa42379

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

$:.unshift "."
require File.join(File.dirname(__FILE__), 'spec_helper')

describe RDF::RDFXML::Format do
  context "discovery" do
    {
      "rdf" => RDF::Format.for(:rdf),
      "rdfxml" => RDF::Format.for(:rdfxml),
      "etc/foaf.xml" => RDF::Format.for("etc/foaf.xml"),
      "etc/foaf.rdf" => RDF::Format.for("etc/foaf.rdf"),
      "foaf.xml" => RDF::Format.for(:file_name      => "foaf.xml"),
      "foaf.rdf" => RDF::Format.for(:file_name      => "foaf.xml"),
      ".xml" => RDF::Format.for(:file_extension => "xml"),
      ".rdf" => RDF::Format.for(:file_extension => "rdf"),
      "application/xml" => RDF::Format.for(:content_type   => "application/xml"),
      "application/rdf+xml" => RDF::Format.for(:content_type   => "application/rdf+xml"),
    }.each_pair do |label, format|
      it "should discover '#{label}'" do
        format.should == RDF::RDFXML::Format
      end
    end
    
    it "should discover 'xml'" do
      RDF::Format.for(:xml).reader.should == RDF::RDFXML::Reader
      RDF::Format.for(:xml).writer.should == RDF::RDFXML::Writer
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rdf-rdfxml-0.3.2.1 spec/format_spec.rb