Sha256: c832a6fe5c8528116a0b93f8a78566db7c3c659ee859065a4970bc0525af72b0

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', 'rdf-n3', 'lib'))
$:.unshift File.dirname(__FILE__)

require 'rubygems'
require 'rspec'
require 'matchers'
require 'rdf/rdfxml'
require 'rdf/ntriples'
require 'rdf/spec'
require 'rdf/spec/matchers'
require 'rdf/isomorphic'
require 'yaml'    # XXX should be in open-uri/cached
require 'open-uri/cached'

# Create and maintain a cache of downloaded URIs
URI_CACHE = File.expand_path(File.join(File.dirname(__FILE__), "uri-cache"))
Dir.mkdir(URI_CACHE) unless File.directory?(URI_CACHE)
OpenURI::Cache.class_eval { @cache_path = URI_CACHE }

module RDF
  module Isomorphic
    alias_method :==, :isomorphic_with?
  end
end

::RSpec.configure do |c|
  c.filter_run :focus => true
  c.run_all_when_everything_filtered = true
  c.exclusion_filter = {
    :ruby => lambda { |version| !(RUBY_VERSION.to_s =~ /^#{version.to_s}/) },
  }
  c.include(RDF::Spec::Matchers)
end

# Heuristically detect the input stream
def detect_format(stream)
  # Got to look into the file to see
  if stream.is_a?(IO) || stream.is_a?(StringIO)
    stream.rewind
    string = stream.read(1000)
    stream.rewind
  else
    string = stream.to_s
  end
  case string
  when /<\w+:RDF/ then :rdf
  when /<RDF/     then :rdf
  #when /<html/i   then :rdfa
  when /@prefix/i then :n3
  else                 :ntriples
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
rdf-rdfxml-0.3.4 spec/spec_helper.rb
rdf-rdfxml-0.3.3.1 spec/spec_helper.rb
the-experimenters-rdf-rdfxml-0.3.4 spec/spec_helper.rb
the-experimenters-rdf-rdfxml-0.3.3 spec/spec_helper.rb
rdf-rdfxml-0.3.3 spec/spec_helper.rb