Skip to content
Browse files

A couple of exclusions for jruby.

Don't run test-suite examples (reader or writer) in CI.
  • Loading branch information...
1 parent 529db11 commit f0b92ddd78a63fe1b7b9fb233c4141f867b4b36d @gkellogg gkellogg committed Aug 26, 2012
Showing with 38 additions and 33 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 spec/matchers.rb
  3. +2 −2 spec/reader_spec.rb
  4. +2 −1 spec/spec_helper.rb
  5. +32 −30 spec/writer_spec.rb
View
1 .gitignore
@@ -3,3 +3,4 @@
/doc/
/.yardoc/
/*.lock
+/.rbx/
View
1 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
View
4 spec/reader_spec.rb
@@ -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">
View
3 spec/spec_helper.rb
@@ -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
View
62 spec/writer_spec.rb
@@ -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

0 comments on commit f0b92dd

Please sign in to comment.
Something went wrong with that request. Please try again.