Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created November 2, 2011 14:21
Show Gist options
  • Save benlangfeld/1333752 to your computer and use it in GitHub Desktop.
Save benlangfeld/1333752 to your computer and use it in GitHub Desktop.
JRuby super fail
require 'nokogiri'
class MyNode < Nokogiri::XML::Node
def self.new(name, doc)
super(name, doc)
end
end
describe MyNode do
it 'should be the same as Nokogiri' do
n1 = Nokogiri::XML::Node.new 'foo', Nokogiri::XML::Document.new
n2 = MyNode.new 'foo', Nokogiri::XML::Document.new
n1.to_xml.should == n2.to_xml
end
end
{14:12}[jruby-1.6.5]~/Desktop ben% rspec nokogiri_java.rb
F
Failures:
1) MyNode should be the same as Nokogiri
Failure/Error: n1.to_xml.should == n2.to_xml
expected: ""
got: "<foo/>" (using ==)
# ./nokogiri_java.rb:13:in `(root)'
Finished in 2.59 seconds
1 example, 1 failure
Failed examples:
rspec ./nokogiri_java.rb:10 # MyNode should be the same as Nokogiri
rspec nokogiri_java.rb 14.78s user 0.76s system 247% cpu 6.287 total
require 'nokogiri'
class MyNode < Nokogiri::XML::Node
def self.new(name, doc)
Nokogiri::XML::Node.new(name, doc)
end
end
describe MyNode do
it 'should be the same as Nokogiri' do
n1 = Nokogiri::XML::Node.new 'foo', Nokogiri::XML::Document.new
n2 = MyNode.new 'foo', Nokogiri::XML::Document.new
n1.to_xml.should == n2.to_xml
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment