Skip to content

Commit

Permalink
chore: add vite_picture_tag coverage for pre-7.1 test paths (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored Jul 16, 2024
1 parent a764196 commit a4f8c56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,19 @@ def test_vite_image_tag
}
end

if Rails.gem_version >= Gem::Version.new('7.1.0')
def test_vite_picture_tag
def test_vite_picture_tag
if Rails.gem_version >= Gem::Version.new('7.1.0')
assert_equal <<~HTML.gsub(/\n\s*/, ''), vite_picture_tag('images/logo.svg', 'images/logo.png', class: 'test', image: { alt: 'Logo' })
<picture class="test">
<source srcset="/vite-production/assets/logo.322aae0c.svg" type="image/svg+xml" />
<source srcset="/vite-production/assets/logo.f42fb7ea.png" type="image/png" />
<img alt="Logo" src="/vite-production/assets/logo.f42fb7ea.png" />
</picture>
HTML
else
assert_raises(NotImplementedError, /vite_picture_tag/) {
vite_picture_tag
}
end
end
end

0 comments on commit a4f8c56

Please sign in to comment.