From 6e21f1f4f80c9556880e72da28e508001690c6db Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Tue, 5 Jan 2021 16:09:40 +0100 Subject: [PATCH 1/7] Move image related tests to a subfolder --- test/unit/{ => images}/test_generated_image.rb | 0 test/unit/{ => images}/test_generated_image_actual.rb | 0 test/unit/{ => images}/test_generated_image_missing.rb | 0 test/unit/{ => images}/test_img_uri.rb | 0 test/unit/{ => images}/test_source_image.rb | 0 test/unit/{ => images}/test_source_image_missing.rb | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename test/unit/{ => images}/test_generated_image.rb (100%) rename test/unit/{ => images}/test_generated_image_actual.rb (100%) rename test/unit/{ => images}/test_generated_image_missing.rb (100%) rename test/unit/{ => images}/test_img_uri.rb (100%) rename test/unit/{ => images}/test_source_image.rb (100%) rename test/unit/{ => images}/test_source_image_missing.rb (100%) diff --git a/test/unit/test_generated_image.rb b/test/unit/images/test_generated_image.rb similarity index 100% rename from test/unit/test_generated_image.rb rename to test/unit/images/test_generated_image.rb diff --git a/test/unit/test_generated_image_actual.rb b/test/unit/images/test_generated_image_actual.rb similarity index 100% rename from test/unit/test_generated_image_actual.rb rename to test/unit/images/test_generated_image_actual.rb diff --git a/test/unit/test_generated_image_missing.rb b/test/unit/images/test_generated_image_missing.rb similarity index 100% rename from test/unit/test_generated_image_missing.rb rename to test/unit/images/test_generated_image_missing.rb diff --git a/test/unit/test_img_uri.rb b/test/unit/images/test_img_uri.rb similarity index 100% rename from test/unit/test_img_uri.rb rename to test/unit/images/test_img_uri.rb diff --git a/test/unit/test_source_image.rb b/test/unit/images/test_source_image.rb similarity index 100% rename from test/unit/test_source_image.rb rename to test/unit/images/test_source_image.rb diff --git a/test/unit/test_source_image_missing.rb b/test/unit/images/test_source_image_missing.rb similarity index 100% rename from test/unit/test_source_image_missing.rb rename to test/unit/images/test_source_image_missing.rb From e0ddfe6fb3227cdbcc9b8b4a810eb12e0b7a3a99 Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Tue, 5 Jan 2021 16:11:11 +0100 Subject: [PATCH 2/7] Move test image files to a subdirectory --- test/{ => image_files}/pestka.jpg | Bin test/{ => image_files}/rms with space.jpg | Bin test/{ => image_files}/rms.gif | Bin test/{ => image_files}/rms.jp2 | Bin test/{ => image_files}/rms.jpg | Bin test/{ => image_files}/rms.png | Bin test/{ => image_files}/rms.webp | Bin test/{ => image_files}/spx.jpg | Bin test/stubs/jekyll.rb | 2 +- test/unit/images/test_generated_image_actual.rb | 2 +- 10 files changed, 2 insertions(+), 2 deletions(-) rename test/{ => image_files}/pestka.jpg (100%) rename test/{ => image_files}/rms with space.jpg (100%) rename test/{ => image_files}/rms.gif (100%) rename test/{ => image_files}/rms.jp2 (100%) rename test/{ => image_files}/rms.jpg (100%) rename test/{ => image_files}/rms.png (100%) rename test/{ => image_files}/rms.webp (100%) rename test/{ => image_files}/spx.jpg (100%) diff --git a/test/pestka.jpg b/test/image_files/pestka.jpg similarity index 100% rename from test/pestka.jpg rename to test/image_files/pestka.jpg diff --git a/test/rms with space.jpg b/test/image_files/rms with space.jpg similarity index 100% rename from test/rms with space.jpg rename to test/image_files/rms with space.jpg diff --git a/test/rms.gif b/test/image_files/rms.gif similarity index 100% rename from test/rms.gif rename to test/image_files/rms.gif diff --git a/test/rms.jp2 b/test/image_files/rms.jp2 similarity index 100% rename from test/rms.jp2 rename to test/image_files/rms.jp2 diff --git a/test/rms.jpg b/test/image_files/rms.jpg similarity index 100% rename from test/rms.jpg rename to test/image_files/rms.jpg diff --git a/test/rms.png b/test/image_files/rms.png similarity index 100% rename from test/rms.png rename to test/image_files/rms.png diff --git a/test/rms.webp b/test/image_files/rms.webp similarity index 100% rename from test/rms.webp rename to test/image_files/rms.webp diff --git a/test/spx.jpg b/test/image_files/spx.jpg similarity index 100% rename from test/spx.jpg rename to test/image_files/spx.jpg diff --git a/test/stubs/jekyll.rb b/test/stubs/jekyll.rb index 6c26e2ea..7617ae7c 100644 --- a/test/stubs/jekyll.rb +++ b/test/stubs/jekyll.rb @@ -16,7 +16,7 @@ def build_defaults 'url' => 'example.com' } @data = { 'picture' => @pdata } @page = { 'ext' => 'html' } - @site_source = TestHelper::TEST_DIR + @site_source = File.join TestHelper::TEST_DIR, 'image_files' @cache_dir = '/tmp/jpt/cache' end diff --git a/test/unit/images/test_generated_image_actual.rb b/test/unit/images/test_generated_image_actual.rb index a3ae9ae8..ab38d139 100644 --- a/test/unit/images/test_generated_image_actual.rb +++ b/test/unit/images/test_generated_image_actual.rb @@ -26,7 +26,7 @@ def tested(basename = 'rms', ext = 'jpg') # Actual test image source file def source_image(basename, ext) @source_image ||= SourceImageStub.new(base_name: basename, - name: File.join(TEST_DIR, "#{basename}.#{ext}"), + name: File.join(TEST_DIR, 'image_files', "#{basename}.#{ext}"), missing: false, digest: 'r' * 6, ext: ext) From 11a266ac1b1631123c2895a808ee15808da99169 Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Fri, 8 Jan 2021 15:57:10 +0100 Subject: [PATCH 3/7] Extract test stubs --- test/stubs.rb | 3 + test/stubs/jekyll.rb | 221 +------------------------- test/stubs/presets.rb | 220 +++++++++++++++++++++++++ test/stubs/structs.rb | 39 +++++ test/test_helper.rb | 37 +---- test/unit/images/test_source_image.rb | 2 +- test/unit/instructions/test_config.rb | 1 - test/unit/instructions/test_preset.rb | 3 - 8 files changed, 269 insertions(+), 257 deletions(-) create mode 100644 test/stubs.rb create mode 100644 test/stubs/presets.rb create mode 100644 test/stubs/structs.rb diff --git a/test/stubs.rb b/test/stubs.rb new file mode 100644 index 00000000..5fedac8e --- /dev/null +++ b/test/stubs.rb @@ -0,0 +1,3 @@ +require_relative 'stubs/presets' +require_relative 'stubs/structs' +require_relative 'stubs/jekyll' diff --git a/test/stubs/jekyll.rb b/test/stubs/jekyll.rb index 7617ae7c..dc5f542f 100644 --- a/test/stubs/jekyll.rb +++ b/test/stubs/jekyll.rb @@ -1,24 +1,7 @@ # Tools to stub the jekyll and liquid interfaces -module JekyllStub - ContextStub = Struct.new(:environments, :registers) - SiteStub = Struct.new(:config, :data, :source, :dest, :cache_dir) - - def build_defaults - @widths = [25, 50, 100] - @pconfig = {} - @pdata = picture_data_stub - - @jekyll_env = 'development' - @site_dest = '/tmp/jpt' - @jconfig = { 'picture' => @pconfig, - 'keep_files' => [], - 'destination' => @site_dest, - 'url' => 'example.com' } - @data = { 'picture' => @pdata } - @page = { 'ext' => 'html' } - @site_source = File.join TestHelper::TEST_DIR, 'image_files' - @cache_dir = '/tmp/jpt/cache' - end +module Stubs + include Presets + include Structs def build_context_stub environments = [{ 'jekyll' => { 'environment' => @jekyll_env } }] @@ -51,203 +34,7 @@ def stub_liquid_tag def stub_template_parsing template_stub = Object.new Liquid::Template.stubs(:parse).with do |params| - template_stub.define_singleton_method(:render) { |_context| params } + template_stub.stubs(:render).returns(params) end.returns(template_stub) end - - def picture_data_stub - { - 'presets' => { - 'default' => { - 'widths' => @widths - }, - - 'auto' => { - 'widths' => @widths, - 'formats' => %w[webp original] - }, - - 'data_auto' => { - 'markup' => 'data_auto', - 'widths' => @widths, - 'formats' => %w[webp original] - }, - - 'data_img' => { - 'markup' => 'data_img', - 'widths' => @widths - }, - - 'data_picture' => { - 'markup' => 'data_picture', - 'widths' => @widths, - 'formats' => %w[webp original] - }, - - 'data_img_no_size' => { - 'markup' => 'data_img', - 'widths' => @widths, - 'sizes' => { - 'mobile' => '80vw' - }, - 'size' => '50%', - 'data_sizes' => false - }, - - 'data_img_yes_size' => { - 'markup' => 'data_img', - 'widths' => @widths, - 'sizes' => { - 'mobile' => '80vw' - }, - 'size' => '50%', - 'data_sizes' => true - }, - - 'direct_url' => { - 'markup' => 'direct_url', - 'fallback_width' => 100 - }, - - 'img' => { - 'markup' => 'img', - 'widths' => @widths - }, - - 'naked_srcset' => { - 'markup' => 'naked_srcset', - 'widths' => @widths - }, - - 'sizes' => { - 'sizes' => { - 'mobile' => '80vw' - }, - 'size' => '50%' - }, - - 'pixel_ratio' => { - 'base_width' => 10, - 'pixel_ratios' => [1, 2, 3] - }, - - 'attributes' => { - 'formats' => %w[webp original], - 'widths' => @widths, - 'attributes' => { - 'parent' => 'class="parent"', - 'alt' => 'Alternate Text', - 'a' => 'class="anchor"', - 'picture' => 'data-awesomeness="11"', - 'source' => 'class="source"', - 'img' => 'class="img"' - } - }, - - 'link_source' => { - 'widths' => @widths, - 'link_source' => true - }, - - 'media_widths' => { - 'widths' => @widths, - 'media_widths' => { - 'mobile' => [10, 20, 30] - } - }, - - 'data_noscript' => { - 'markup' => 'data_img', - 'widths' => @widths, - 'noscript' => true - }, - - 'fallback' => { - 'widths' => @widths, - 'fallback_width' => 35, - 'fallback_format' => 'webp' - }, - - 'nomarkdown' => { - 'widths' => @widths, - 'nomarkdown' => true - }, - - 'too_large' => { - 'widths' => [400, 600, 800], - 'fallback_width' => 800 - }, - - 'formats' => { - 'widths' => [100], - 'fallback_width' => 100, - 'formats' => %w[jpg jp2 png webp gif] - }, - - 'quality' => { - 'widths' => [100], - 'quality' => 30, - 'format_quality' => { - 'webp' => 45 - } - }, - - 'format_quality' => { - 'widths' => [100], - 'quality' => 30, - 'format_quality' => { - 'jpg' => 45 - } - }, - - 'calculated_quality' => { - 'quality' => { - 50 => 50, - 100 => 100 - } - }, - - 'calculated_quality_reverse' => { - 'quality' => { - 100 => 100, - 50 => 50 - } - }, - - 'crop' => { - 'crop' => '3:2', - 'media_crop' => { - 'mobile' => '16:9' - }, - 'gravity' => 'north', - 'media_gravity' => { - 'mobile' => 'northwest' - } - }, - - 'dimension_attributes' => { - 'dimension_attributes' => true - }, - - 'dimension_attributes_multiformat' => { - 'dimension_attributes' => true, - 'formats' => %w[original webp] - }, - - 'dimension_attributes_replace_values' => { - 'dimension_attributes' => true, - 'attributes' => { - 'img' => { - 'height' => 'auto' - } - } - - } - }, - - 'media_queries' => { - 'mobile' => 'max-width: 600px' - } - } - end end diff --git a/test/stubs/presets.rb b/test/stubs/presets.rb new file mode 100644 index 00000000..743787e9 --- /dev/null +++ b/test/stubs/presets.rb @@ -0,0 +1,220 @@ +module Stubs + # Handles stubbed picture configuration + module Presets + def build_defaults + @widths = [25, 50, 100] + @pconfig = {} + @pdata = picture_data_stub + + @jekyll_env = 'development' + @site_dest = '/tmp/jpt' + @jconfig = { 'picture' => @pconfig, + 'keep_files' => [], + 'destination' => @site_dest, + 'url' => 'example.com' } + @data = { 'picture' => @pdata } + @page = { 'ext' => 'html' } + @site_source = File.join TestHelper::TEST_DIR, 'image_files' + @cache_dir = '/tmp/jpt/cache' + end + + def picture_data_stub + { 'presets' => presets, + 'media_queries' => media_queries } + end + + def media_queries + { 'mobile' => 'max-width: 600px' } + end + + def presets + { + 'default' => { + 'widths' => @widths + }, + + 'auto' => { + 'widths' => @widths, + 'formats' => %w[webp original] + }, + + 'data_auto' => { + 'markup' => 'data_auto', + 'widths' => @widths, + 'formats' => %w[webp original] + }, + + 'data_img' => { + 'markup' => 'data_img', + 'widths' => @widths + }, + + 'data_picture' => { + 'markup' => 'data_picture', + 'widths' => @widths, + 'formats' => %w[webp original] + }, + + 'data_img_no_size' => { + 'markup' => 'data_img', + 'widths' => @widths, + 'sizes' => { + 'mobile' => '80vw' + }, + 'size' => '50%', + 'data_sizes' => false + }, + + 'data_img_yes_size' => { + 'markup' => 'data_img', + 'widths' => @widths, + 'sizes' => { + 'mobile' => '80vw' + }, + 'size' => '50%', + 'data_sizes' => true + }, + + 'direct_url' => { + 'markup' => 'direct_url', + 'fallback_width' => 100 + }, + + 'img' => { + 'markup' => 'img', + 'widths' => @widths + }, + + 'naked_srcset' => { + 'markup' => 'naked_srcset', + 'widths' => @widths + }, + + 'sizes' => { + 'sizes' => { + 'mobile' => '80vw' + }, + 'size' => '50%' + }, + + 'pixel_ratio' => { + 'base_width' => 10, + 'pixel_ratios' => [1, 2, 3] + }, + + 'attributes' => { + 'formats' => %w[webp original], + 'widths' => @widths, + 'attributes' => { + 'parent' => 'class="parent"', + 'alt' => 'Alternate Text', + 'a' => 'class="anchor"', + 'picture' => 'data-awesomeness="11"', + 'source' => 'class="source"', + 'img' => 'class="img"' + } + }, + + 'link_source' => { + 'widths' => @widths, + 'link_source' => true + }, + + 'media_widths' => { + 'widths' => @widths, + 'media_widths' => { + 'mobile' => [10, 20, 30] + } + }, + + 'data_noscript' => { + 'markup' => 'data_img', + 'widths' => @widths, + 'noscript' => true + }, + + 'fallback' => { + 'widths' => @widths, + 'fallback_width' => 35, + 'fallback_format' => 'webp' + }, + + 'nomarkdown' => { + 'widths' => @widths, + 'nomarkdown' => true + }, + + 'too_large' => { + 'widths' => [400, 600, 800], + 'fallback_width' => 800 + }, + + 'formats' => { + 'widths' => [100], + 'fallback_width' => 100, + 'formats' => %w[jpg jp2 png webp gif] + }, + + 'quality' => { + 'widths' => [100], + 'quality' => 30, + 'format_quality' => { + 'webp' => 45 + } + }, + + 'format_quality' => { + 'widths' => [100], + 'quality' => 30, + 'format_quality' => { + 'jpg' => 45 + } + }, + + 'calculated_quality' => { + 'quality' => { + 50 => 50, + 100 => 100 + } + }, + + 'calculated_quality_reverse' => { + 'quality' => { + 100 => 100, + 50 => 50 + } + }, + + 'crop' => { + 'crop' => '3:2', + 'media_crop' => { + 'mobile' => '16:9' + }, + 'gravity' => 'north', + 'media_gravity' => { + 'mobile' => 'northwest' + } + }, + + 'dimension_attributes' => { + 'dimension_attributes' => true + }, + + 'dimension_attributes_multiformat' => { + 'dimension_attributes' => true, + 'formats' => %w[original webp] + }, + + 'dimension_attributes_replace_values' => { + 'dimension_attributes' => true, + 'attributes' => { + 'img' => { + 'height' => 'auto' + } + } + + } + } + end + end +end diff --git a/test/stubs/structs.rb b/test/stubs/structs.rb new file mode 100644 index 00000000..dd7e9c92 --- /dev/null +++ b/test/stubs/structs.rb @@ -0,0 +1,39 @@ +module Stubs + module Structs + # Internal classes + + ConfigStub = + Struct.new(:source_dir) + + # Rubocop doesn't want us to override to_s in a struct. Since it's for a test + # stub, it's fine. + # rubocop:disable Lint/StructNewOverride + SrcsetStub = + Struct.new(:sizes, :to_s, :media, :mime_type, :media_attribute) + # rubocop:enable Lint/StructNewOverride + + SourceImageStub = + Struct.new(:base_name, :name, :missing, :digest, :ext, :width, :shortname, + :media_preset, :digest_guess, keyword_init: true) + + GeneratedImageStub = + Struct.new(:name, :width, :uri, :format, :exists?, :generate, keyword_init: + true) + + # External classes + SiteStub = + Struct.new(:config, :data, :source, :dest, :cache_dir) + + ContextStub = + Struct.new(:environments, :registers) + + TokenStub = + Struct.new(:line_number, :locale) + + SingleTagStub = + Struct.new(:name, :attributes) + + ImageStub = + Struct.new(:width, :height) + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 6fc57c5c..80595849 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -11,45 +11,12 @@ require 'pry' require 'nokogiri' require 'jekyll_picture_tag' -require_relative 'stubs/jekyll' +require_relative 'stubs' # This module gives us a basic setup to run our tests. module TestHelper TEST_DIR = __dir__ - include JekyllStub - - ImageStruct = Struct.new(:width, :height) - TokenStub = Struct.new(:line_number, :locale) - ConfigStub = Struct.new(:source_dir) - SourceImageStub = Struct.new( - :base_name, - :name, - :missing, - :digest, - :ext, - :width, - :shortname, - :media_preset, - :digest_guess, - keyword_init: true - ) - - GeneratedImageStub = Struct.new( - :name, :width, :uri, :format, :exists?, :generate, keyword_init: true - ) - - SingleTagStub = Struct.new( - :name, :attributes - ) - - SrcsetStub = Struct.new( - # Rubocop complains about overriding the to_s method, which would - # ordinaraily cause problems but as we're using it here to stub an existing - # to_s method it's fine. - # rubocop:disable Lint/StructNewOverride - :sizes, :to_s, :media, :mime_type, :media_attribute - # rubocop:enable Lint/StructNewOverride - ) + include Stubs def nomarkdown_wrapped?(string) # rubocop:disable Style/RegexpLiteral diff --git a/test/unit/images/test_source_image.rb b/test/unit/images/test_source_image.rb index b3f43f0b..2c0a5cbd 100644 --- a/test/unit/images/test_source_image.rb +++ b/test/unit/images/test_source_image.rb @@ -9,7 +9,7 @@ def setup PictureTag.stubs(:fast_build?).returns(false) Cache::Source.stubs(:new).returns(cache_stub) File.stubs(:read) - MiniMagick::Image.stubs(:open).returns(ImageStruct.new(50, 60)) + MiniMagick::Image.stubs(:open).returns(ImageStub.new(50, 60)) Digest::MD5.stubs(:hexdigest) .returns('abc123') File.stubs(:exist?).returns(true) diff --git a/test/unit/instructions/test_config.rb b/test/unit/instructions/test_config.rb index af19289a..8dd0e097 100644 --- a/test/unit/instructions/test_config.rb +++ b/test/unit/instructions/test_config.rb @@ -2,7 +2,6 @@ class ConfigTest < Minitest::Test include PictureTag include TestHelper - include JekyllStub def setup build_defaults diff --git a/test/unit/instructions/test_preset.rb b/test/unit/instructions/test_preset.rb index 2f2dd92c..cd2edfe0 100644 --- a/test/unit/instructions/test_preset.rb +++ b/test/unit/instructions/test_preset.rb @@ -2,9 +2,6 @@ class PresetTest < Minitest::Test include PictureTag include TestHelper - include JekyllStub - # Honestly, this one is more a test of my stubs than a test of the logic. - # The preset stubs can be found in test/stubs/jekyll.rb def setup build_defaults From cc6b6f44d449b095478454975a3b3526a0fb553d Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Fri, 8 Jan 2021 15:58:32 +0100 Subject: [PATCH 4/7] Increase test coverage requirement from 80% to 100% --- test/test_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 80595849..31f672e2 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,7 @@ require 'simplecov' require 'minitest/rg' -SimpleCov.minimum_coverage_by_file 80 +SimpleCov.minimum_coverage_by_file 100 SimpleCov.start do add_filter '/test/' end From fb7ca5c8d7b7fded20b1c9ac085b19427c9a258e Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Fri, 8 Jan 2021 17:01:36 +0100 Subject: [PATCH 5/7] Refactor test structs --- test/stubs/structs.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/stubs/structs.rb b/test/stubs/structs.rb index dd7e9c92..fc43a024 100644 --- a/test/stubs/structs.rb +++ b/test/stubs/structs.rb @@ -1,10 +1,14 @@ module Stubs module Structs - # Internal classes + # Jekyll Picture Tag classes: ConfigStub = Struct.new(:source_dir) + GeneratedImageStub = + Struct.new(:name, :width, :uri, :format, :exists?, :generate, keyword_init: + true) + # Rubocop doesn't want us to override to_s in a struct. Since it's for a test # stub, it's fine. # rubocop:disable Lint/StructNewOverride @@ -16,11 +20,8 @@ module Structs Struct.new(:base_name, :name, :missing, :digest, :ext, :width, :shortname, :media_preset, :digest_guess, keyword_init: true) - GeneratedImageStub = - Struct.new(:name, :width, :uri, :format, :exists?, :generate, keyword_init: - true) + # Jekyll classes: - # External classes SiteStub = Struct.new(:config, :data, :source, :dest, :cache_dir) @@ -30,9 +31,13 @@ module Structs TokenStub = Struct.new(:line_number, :locale) + # Objective Elements classes: + SingleTagStub = Struct.new(:name, :attributes) + # MiniMagick classes: + ImageStub = Struct.new(:width, :height) end From 9860136740582f8b9bab6bfae27b7ad18a9fbcd5 Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Fri, 8 Jan 2021 17:09:14 +0100 Subject: [PATCH 6/7] Rename output format test helper --- .../{test_helper_output.rb => output_format_test_helper.rb} | 0 test/unit/output_formats/test_data_img.rb | 2 +- test/unit/output_formats/test_data_picture.rb | 2 +- test/unit/output_formats/test_direct_url.rb | 2 +- test/unit/output_formats/test_img.rb | 2 +- test/unit/output_formats/test_naked_srcset.rb | 2 +- test/unit/output_formats/test_picture.rb | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename test/unit/output_formats/{test_helper_output.rb => output_format_test_helper.rb} (100%) diff --git a/test/unit/output_formats/test_helper_output.rb b/test/unit/output_formats/output_format_test_helper.rb similarity index 100% rename from test/unit/output_formats/test_helper_output.rb rename to test/unit/output_formats/output_format_test_helper.rb diff --git a/test/unit/output_formats/test_data_img.rb b/test/unit/output_formats/test_data_img.rb index f1b1edf5..d229de84 100644 --- a/test/unit/output_formats/test_data_img.rb +++ b/test/unit/output_formats/test_data_img.rb @@ -1,4 +1,4 @@ -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestDataImg < Minitest::Test include PictureTag diff --git a/test/unit/output_formats/test_data_picture.rb b/test/unit/output_formats/test_data_picture.rb index 3bb49524..66bb6b81 100644 --- a/test/unit/output_formats/test_data_picture.rb +++ b/test/unit/output_formats/test_data_picture.rb @@ -1,4 +1,4 @@ -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestDataPicture < Minitest::Test include PictureTag diff --git a/test/unit/output_formats/test_direct_url.rb b/test/unit/output_formats/test_direct_url.rb index 671c17de..2314d647 100644 --- a/test/unit/output_formats/test_direct_url.rb +++ b/test/unit/output_formats/test_direct_url.rb @@ -1,4 +1,4 @@ -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestDirectUrl < Minitest::Test include PictureTag diff --git a/test/unit/output_formats/test_img.rb b/test/unit/output_formats/test_img.rb index 0ff96231..2217e70b 100644 --- a/test/unit/output_formats/test_img.rb +++ b/test/unit/output_formats/test_img.rb @@ -1,4 +1,4 @@ -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestImg < Minitest::Test include PictureTag diff --git a/test/unit/output_formats/test_naked_srcset.rb b/test/unit/output_formats/test_naked_srcset.rb index 1387304a..563b2524 100644 --- a/test/unit/output_formats/test_naked_srcset.rb +++ b/test/unit/output_formats/test_naked_srcset.rb @@ -1,4 +1,4 @@ -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestNakedSrcset < Minitest::Test include PictureTag diff --git a/test/unit/output_formats/test_picture.rb b/test/unit/output_formats/test_picture.rb index ed709819..b71b64d6 100644 --- a/test/unit/output_formats/test_picture.rb +++ b/test/unit/output_formats/test_picture.rb @@ -1,5 +1,5 @@ require 'test_helper' -require_relative './test_helper_output' +require_relative './output_format_test_helper' class TestPicture < Minitest::Test include PictureTag From adf2954772d76627d6bd6f247ec092ea32178fbe Mon Sep 17 00:00:00 2001 From: Robert Buchberger Date: Fri, 8 Jan 2021 17:10:41 +0100 Subject: [PATCH 7/7] Rename srcsets test helper --- .../srcsets/{test_helper_srcsets.rb => srcsets_test_helper.rb} | 0 test/unit/srcsets/test_pixel_ratio.rb | 2 +- test/unit/srcsets/test_width.rb | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename test/unit/srcsets/{test_helper_srcsets.rb => srcsets_test_helper.rb} (100%) diff --git a/test/unit/srcsets/test_helper_srcsets.rb b/test/unit/srcsets/srcsets_test_helper.rb similarity index 100% rename from test/unit/srcsets/test_helper_srcsets.rb rename to test/unit/srcsets/srcsets_test_helper.rb diff --git a/test/unit/srcsets/test_pixel_ratio.rb b/test/unit/srcsets/test_pixel_ratio.rb index 374db961..9d5f75e7 100644 --- a/test/unit/srcsets/test_pixel_ratio.rb +++ b/test/unit/srcsets/test_pixel_ratio.rb @@ -1,4 +1,4 @@ -require_relative 'test_helper_srcsets' +require_relative 'srcsets_test_helper' class TestSrcsetPixelRatio < Minitest::Test include TestHelperSrcset diff --git a/test/unit/srcsets/test_width.rb b/test/unit/srcsets/test_width.rb index 89349a76..1a9e7fe3 100644 --- a/test/unit/srcsets/test_width.rb +++ b/test/unit/srcsets/test_width.rb @@ -1,4 +1,4 @@ -require_relative 'test_helper_srcsets' +require_relative 'srcsets_test_helper' class TestSrcsetWidth < Minitest::Test include TestHelperSrcset