diff --git a/.rubocop.yml b/.rubocop.yml index bd088278..66b68f47 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -75,7 +75,6 @@ AllCops: - test/test_entry_filter.rb - test/test_filters.rb - test/test_kramdown.rb - - test/test_liquid_extensions.rb - test/test_liquid_renderer.rb - test/test_log_adapter.rb - test/test_new_command.rb diff --git a/test/test_liquid_extensions.rb b/test/test_liquid_extensions.rb index 0ab95e94..a76f3786 100644 --- a/test/test_liquid_extensions.rb +++ b/test/test_liquid_extensions.rb @@ -1,12 +1,11 @@ -require 'helper' +require "helper" class TestLiquidExtensions < JekyllUnitTest - context "looking up a variable in a Liquid context" do class SayHi < Liquid::Tag include Jekyll::LiquidExtensions - def initialize(tag_name, markup, tokens) + def initialize(_tag_name, markup, _tokens) @markup = markup.strip end @@ -14,18 +13,18 @@ class TestLiquidExtensions < JekyllUnitTest "hi #{lookup_variable(context, @markup)}" end end - Liquid::Template.register_tag('say_hi', SayHi) + Liquid::Template.register_tag("say_hi", SayHi) setup do - @template = Liquid::Template.parse("{% say_hi page.name %}") # Parses and compiles the template + # Parses and compiles the template + @template = Liquid::Template.parse("{% say_hi page.name %}") end should "extract the var properly" do - assert_equal @template.render({'page' => {'name' => 'tobi'}}), 'hi tobi' + assert_equal @template.render({ "page" => { "name" => "tobi" } }), "hi tobi" end should "return the variable name if the value isn't there" do - assert_equal @template.render({'page' => {'title' => 'tobi'}}), 'hi page.name' + assert_equal @template.render({ "page" => { "title" => "tobi" } }), "hi page.name" end end - end