Consolidate some tests to reduce the test:code ratio
This commit is contained in:
parent
ba3db6eba7
commit
746205e726
|
@ -3,33 +3,22 @@ Feature: Extra image generation
|
|||
I want to resize images that aren't used in posts or pages
|
||||
In order to use them in my stylesheets
|
||||
|
||||
Scenario: Resizing a single image
|
||||
Scenario: Specifying a single image and glob patterns
|
||||
Given I have a responsive_image configuration with:
|
||||
"""
|
||||
sizes:
|
||||
- width: 100
|
||||
extra_images:
|
||||
- assets/everybody-loves-jalapeño-pineapple-cornbread.png
|
||||
- assets/*.jpeg
|
||||
"""
|
||||
|
||||
And I have a file "index.html" with "Hello, world!"
|
||||
When I run Jekyll
|
||||
Then the image "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should have the dimensions "100x50"
|
||||
And the image "assets/resized/progressive-100x50.jpeg" should have the dimensions "100x50"
|
||||
And the file "_site/assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should exist
|
||||
|
||||
Scenario: Using glob patterns
|
||||
Given I have a responsive_image configuration with:
|
||||
"""
|
||||
sizes:
|
||||
- width: 100
|
||||
extra_images:
|
||||
- assets/*.png
|
||||
"""
|
||||
|
||||
And I have a file "index.html" with "Hello, world!"
|
||||
When I run Jekyll
|
||||
Then the image "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should have the dimensions "100x50"
|
||||
And the file "_site/assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should exist
|
||||
And the file "_site/assets/resized/progressive-100x50.jpeg" should exist
|
||||
|
||||
Scenario: Honouring Jekyll 'source' configuration
|
||||
Given I have copied my site to "sub-dir/my-site-copy"
|
||||
|
|
|
@ -4,36 +4,6 @@ Feature: Image hashes inside responsive image templates
|
|||
In order to create custom responsive image templates
|
||||
|
||||
Scenario: Using the {% responsive_image %} tag
|
||||
Given I have a configuration with:
|
||||
"""
|
||||
responsive_image:
|
||||
template: _includes/hash.html
|
||||
output_path_format: assets/resized/%{dirname}/%{width}/%{basename}
|
||||
sizes:
|
||||
- width: 100
|
||||
"""
|
||||
And I have a file "index.html" with "{% responsive_image path: assets/subdir/test.png %}"
|
||||
When I run Jekyll
|
||||
Then the file "_site/index.html" should contain:
|
||||
"""
|
||||
path: assets/subdir/test.png
|
||||
width: 300
|
||||
height: 150
|
||||
basename: test.png
|
||||
dirname: subdir
|
||||
filename: test
|
||||
extension: png
|
||||
|
||||
path: assets/resized/subdir/100/test.png
|
||||
width: 100
|
||||
height: 50
|
||||
basename: test.png
|
||||
dirname: resized/subdir/100
|
||||
filename: test
|
||||
extension: png
|
||||
"""
|
||||
|
||||
Scenario: Honouring Jekyll 'source' configuration
|
||||
Given I have copied my site to "my-site-copy/src"
|
||||
And I have a configuration with:
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue