Skip to content

Commit

Permalink
A couple of exclusions for jruby.
Browse files Browse the repository at this point in the history
Don't run test-suite examples (reader or writer) in CI.
  • Loading branch information
gkellogg committed Aug 26, 2012
1 parent 529db11 commit f0b92dd
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@
/doc/
/.yardoc/
/*.lock
/.rbx/
1 change: 1 addition & 0 deletions spec/matchers.rb
@@ -1,4 +1,5 @@
require 'rspec/matchers'
require 'nokogiri'

RSpec::Matchers.define :have_xpath do |xpath, value, trace|
xpath = xpath.gsub("xhtml:", "") # Using HTML parser, no namespaces needed
Expand Down
4 changes: 2 additions & 2 deletions spec/reader_spec.rb
Expand Up @@ -177,8 +177,8 @@
end

context :features do
describe "XML Literal" do
it "rdf:XMLLitereal" do
describe "XML Literal", :not_jruby => true do
it "rdf:XMLLiteral" do
html = %(<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -24,7 +24,8 @@
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}/) },
:ruby => lambda { |version| !(RUBY_VERSION.to_s =~ /^#{version}/) },
:not_jruby => lambda { RUBY_PLATFORM.to_s != 'jruby'}
}
c.include(RDF::Spec::Matchers)
end
Expand Down
62 changes: 32 additions & 30 deletions spec/writer_spec.rb
Expand Up @@ -475,36 +475,38 @@ class EX < RDF::Vocabulary("http://example/"); end
end
end

# W3C Test suite from http://www.w3.org/2006/07/SWD/RDFa/testsuite/
describe "w3c xhtml testcases" do
require 'suite_helper'

# Generate with each template set
RDF::RDFa::Writer::HAML_TEMPLATES.each do |name, template|
context "Using #{name} template" do
Fixtures::TestCase.for_specific("html5", "rdfa1.1", Fixtures::TestCase::Test.required) do |t|
specify "test #{t.name}: #{t.title}" do
begin
input = t.input("html5", "rdfa1.1")
@graph = RDF::Graph.load(t.input("html5", "rdfa1.1"))
result = serialize(:haml => template, :haml_options => {:ugly => false})
graph2 = parse(result, :format => :rdfa)
# Need to put this in to avoid problems with added markup
statements = graph2.query(:object => RDF::URI("http://rdf.kellogg-assoc.com/css/distiller.css")).to_a
statements.each {|st| graph2.delete(st)}
#puts graph2.dump(:ttl)
graph2.should be_equivalent_graph(@graph, :trace => @debug.unshift(result).join("\n"))
rescue RSpec::Expectations::ExpectationNotMetError => e
if %w(0198).include?(t.name) || t.title =~ /XMLLiteral/
pending("XMLLiteral aren't serialized canonically")
elsif %w(0225).include?(t.name)
pending("Serializing multiple lists")
elsif %w(0284).include?(t.name)
pending("Minor change in time element")
elsif %w(0295).include?(t.name)
pending("Benchmark entry count")
else
raise
unless ENV['CI'] # Not for continuous integration
# W3C Test suite from http://www.w3.org/2006/07/SWD/RDFa/testsuite/
describe "w3c xhtml testcases" do
require 'suite_helper'

# Generate with each template set
RDF::RDFa::Writer::HAML_TEMPLATES.each do |name, template|
context "Using #{name} template" do
Fixtures::TestCase.for_specific("html5", "rdfa1.1", Fixtures::TestCase::Test.required) do |t|
specify "test #{t.name}: #{t.title}" do
begin
input = t.input("html5", "rdfa1.1")
@graph = RDF::Graph.load(t.input("html5", "rdfa1.1"))
result = serialize(:haml => template, :haml_options => {:ugly => false})
graph2 = parse(result, :format => :rdfa)
# Need to put this in to avoid problems with added markup
statements = graph2.query(:object => RDF::URI("http://rdf.kellogg-assoc.com/css/distiller.css")).to_a
statements.each {|st| graph2.delete(st)}
#puts graph2.dump(:ttl)
graph2.should be_equivalent_graph(@graph, :trace => @debug.unshift(result).join("\n"))
rescue RSpec::Expectations::ExpectationNotMetError => e
if %w(0198).include?(t.name) || t.title =~ /XMLLiteral/
pending("XMLLiteral aren't serialized canonically")
elsif %w(0225).include?(t.name)
pending("Serializing multiple lists")
elsif %w(0284).include?(t.name)
pending("Minor change in time element")
elsif %w(0295).include?(t.name)
pending("Benchmark entry count")
else
raise
end
end
end
end
Expand Down

0 comments on commit f0b92dd

Please sign in to comment.