test/helpers/test_link_to.rb in nanoc-3.7.4 vs test/helpers/test_link_to.rb in nanoc-3.7.5

- old
+ new

@@ -1,9 +1,8 @@ # encoding: utf-8 class Nanoc::Helpers::LinkToTest < Nanoc::TestCase - include Nanoc::Helpers::LinkTo def test_link_to_with_path # Check assert_equal( @@ -38,25 +37,27 @@ def test_link_to_with_attributes # Check assert_equal( '<a title="Dis mai foo!" href="/foo/">Foo</a>', - link_to('Foo', '/foo/', :title => 'Dis mai foo!') + link_to('Foo', '/foo/', title: 'Dis mai foo!') ) end def test_link_to_escape # Check assert_equal( '<a title="Foo &amp; Bar" href="/foo&amp;bar/">Foo &amp; Bar</a>', - link_to('Foo &amp; Bar', '/foo&bar/', :title => 'Foo & Bar') + link_to('Foo &amp; Bar', '/foo&bar/', title: 'Foo & Bar') ) end def test_link_to_to_nil_item_or_item_rep obj = Object.new - def obj.path; nil; end + def obj.path + nil + end assert_raises RuntimeError do link_to('Some Text', obj) end end @@ -149,11 +150,10 @@ '../../quux/', relative_path_to(other_item_rep) ) end - def test_relative_path_to_item # Mock self @item_rep = mock @item_rep.stubs(:path).returns('/foo/bar/baz/') @@ -248,7 +248,6 @@ @item_rep.stubs(:path).returns('/foo/bar/') # Run assert_examples_correct 'Nanoc::Helpers::LinkTo#relative_path_to' end - end