Created
November 2, 2011 14:21
-
-
Save benlangfeld/1333752 to your computer and use it in GitHub Desktop.
JRuby super fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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