diff --git a/lib/gollum-lib/filter/toc.rb b/lib/gollum-lib/filter/toc.rb index 5431ce4f..1fe08946 100644 --- a/lib/gollum-lib/filter/toc.rb +++ b/lib/gollum-lib/filter/toc.rb @@ -125,7 +125,7 @@ def generate_anchor_name(header) # Creates an anchor element with the given name and adds it before # the given header element. def add_anchor_to_header(header, name) - a = Nokogiri::XML::Node.new('a', @doc) + a = Nokogiri::XML::Node.new('a', @doc.document) a['class'] = 'anchor' a['id'] = name a['href'] = "##{name}" @@ -143,9 +143,9 @@ def add_entry_to_toc(header, name) if @tail_level < level while @tail_level < level - list = Nokogiri::XML::Node.new('ul', @doc) + list = Nokogiri::XML::Node.new('ul', @doc.document) @tail.add_child(list) - @tail = list.add_child(Nokogiri::XML::Node.new('li', @doc)) + @tail = list.add_child(Nokogiri::XML::Node.new('li', @doc.document)) @tail_level += 1 end else @@ -153,7 +153,7 @@ def add_entry_to_toc(header, name) @tail = @tail.parent.parent @tail_level -= 1 end - @tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc)) + @tail = @tail.parent.add_child(Nokogiri::XML::Node.new('li', @doc.document)) end # % -> %25 so anchors work on Firefox. See issue #475 diff --git a/test/helper.rb b/test/helper.rb index 70bb3be0..cb11ecb3 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -6,7 +6,7 @@ # external require 'rubygems' require 'shoulda' -require 'mocha/setup' +require 'mocha/test_unit' require 'minitest/reporters' require 'twitter_cldr' require 'tempfile'