From 0937dbf4eceda50572b34f792fee739248e9006a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 11 Apr 2012 09:45:44 -0700 Subject: [PATCH] Failing test for relativize_paths filter. This fails only when the `` and `` are on the same line, and seems to only fail when the `href` attribute of the `` is `"/"`. --HG-- extra : transplant_source : %F8%EB%19%87%B55%12%D3%11f%1E%B4%1C%DF%D9X%DD%D3%FF%AC --- test/filters/test_relativize_paths.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/filters/test_relativize_paths.rb b/test/filters/test_relativize_paths.rb index 2c94ce8e48..729bb9dda0 100644 --- a/test/filters/test_relativize_paths.rb +++ b/test/filters/test_relativize_paths.rb @@ -101,6 +101,30 @@ def test_filter_html_multiple assert_equal(expected_content, actual_content) end + def test_filter_html_nested + # Create filter with mock item + filter = Nanoc::Filters::RelativizePaths.new + + # Mock item + filter.instance_eval do + @item_rep = Nanoc::ItemRep.new( + Nanoc::Item.new( + 'content', + {}, + '/foo/bar/baz/'), + :blah) + @item_rep.path = '/foo/bar/baz/' + end + + # Set content + raw_content = %[] + expected_content = %[] + + # Test + actual_content = filter.run(raw_content, :type => :html) + assert_equal(expected_content, actual_content) + end + def test_filter_html_outside_tag # Create filter with mock item filter = Nanoc::Filters::RelativizePaths.new