added test to save_to_source

This commit is contained in:
Jeric Bryle Sy Dy 2017-06-20 17:22:40 +08:00
parent 93bb666bff
commit 2ad615952e
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
Feature: Save to source
Scenario: Save to source
Given I have a responsive_image configuration with:
"""
save_to_source: true
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
And the file "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should exist
And the file "assets/resized/progressive-100x50.jpeg" should exist
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: Do not save to source
Given I have a responsive_image configuration with:
"""
save_to_source: false
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
And the file "assets/resized/everybody-loves-jalapeño-pineapple-cornbread-100x50.png" should not exist
And the file "assets/resized/progressive-100x50.jpeg" should not exist
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