mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Rubocop fixes (#1182)
This commit is contained in:
@@ -8,7 +8,7 @@ class TemplateUnitTest < Minitest::Test
|
||||
def test_sets_default_localization_in_document
|
||||
t = Template.new
|
||||
t.parse('{%comment%}{%endcomment%}')
|
||||
assert_instance_of I18n, t.root.nodelist[0].options[:locale]
|
||||
assert_instance_of(I18n, t.root.nodelist[0].options[:locale])
|
||||
end
|
||||
|
||||
def test_sets_default_localization_in_context_with_quick_initialization
|
||||
@@ -16,8 +16,8 @@ class TemplateUnitTest < Minitest::Test
|
||||
t.parse('{%comment%}{%endcomment%}', locale: I18n.new(fixture("en_locale.yml")))
|
||||
|
||||
locale = t.root.nodelist[0].options[:locale]
|
||||
assert_instance_of I18n, locale
|
||||
assert_equal fixture("en_locale.yml"), locale.path
|
||||
assert_instance_of(I18n, locale)
|
||||
assert_equal(fixture("en_locale.yml"), locale.path)
|
||||
end
|
||||
|
||||
def test_with_cache_classes_tags_returns_the_same_class
|
||||
@@ -33,7 +33,7 @@ class TemplateUnitTest < Minitest::Test
|
||||
new_klass = Class.new
|
||||
Object.send(:const_set, :CustomTag, new_klass)
|
||||
|
||||
assert Template.tags['custom'].equal?(original_klass)
|
||||
assert(Template.tags['custom'].equal?(original_klass))
|
||||
ensure
|
||||
Object.send(:remove_const, :CustomTag)
|
||||
Template.tags.delete('custom')
|
||||
@@ -53,7 +53,7 @@ class TemplateUnitTest < Minitest::Test
|
||||
new_klass = Class.new
|
||||
Object.send(:const_set, :CustomTag, new_klass)
|
||||
|
||||
assert Template.tags['custom'].equal?(new_klass)
|
||||
assert(Template.tags['custom'].equal?(new_klass))
|
||||
ensure
|
||||
Object.send(:remove_const, :CustomTag)
|
||||
Template.tags.delete('custom')
|
||||
@@ -64,16 +64,16 @@ class TemplateUnitTest < Minitest::Test
|
||||
|
||||
def test_tags_delete
|
||||
Template.register_tag('fake', FakeTag)
|
||||
assert_equal FakeTag, Template.tags['fake']
|
||||
assert_equal(FakeTag, Template.tags['fake'])
|
||||
|
||||
Template.tags.delete('fake')
|
||||
assert_nil Template.tags['fake']
|
||||
assert_nil(Template.tags['fake'])
|
||||
end
|
||||
|
||||
def test_tags_can_be_looped_over
|
||||
Template.register_tag('fake', FakeTag)
|
||||
result = Template.tags.map { |name, klass| [name, klass] }
|
||||
assert result.include?(["fake", "TemplateUnitTest::FakeTag"])
|
||||
assert(result.include?(["fake", "TemplateUnitTest::FakeTag"]))
|
||||
ensure
|
||||
Template.tags.delete('fake')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user