Sha256: 3710245ce2664645b7534741c8c077a0f02a73a0e62f46b770a8c75465143af5

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

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

require "bundler/setup"
require 'rubygems'
require 'rspec'
require 'bigdecimal'  # XXX Remove Me
require 'rdf/rdfa'
require 'rdf/spec'
require 'rdf/spec/matchers'
require 'rdf/isomorphic'
require 'open-uri/cached'
require 'matchers'

# 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 }

::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

TMP_DIR = File.join(File.expand_path(File.dirname(__FILE__)), "tmp")

# 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 /<html/i   then RDF::RDFa::Reader
  when /@prefix/i then RDF::N3::Reader
  else                 RDF::NTriples::Reader
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rdf-rdfa-0.3.4.2 spec/spec_helper.rb
rdf-rdfa-0.3.4.1 spec/spec_helper.rb
rdf-rdfa-0.3.4 spec/spec_helper.rb
rdf-rdfa-0.3.3.3 spec/spec_helper.rb
rdf-rdfa-0.3.3.2 spec/spec_helper.rb
rdf-rdfa-0.3.3.1 spec/spec_helper.rb
rdf-rdfa-0.3.3 spec/spec_helper.rb