From b819d383588dd45d02874b279ed50f1372ccedda Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 2 May 2014 10:19:18 -0700 Subject: [PATCH] Test gzip extensions option. --- middleman-core/features/gzip.feature | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/middleman-core/features/gzip.feature b/middleman-core/features/gzip.feature index 93ae2cf5..9240b05b 100644 --- a/middleman-core/features/gzip.feature +++ b/middleman-core/features/gzip.feature @@ -3,12 +3,12 @@ Feature: GZIP assets during build Scenario: Built assets should be gzipped Given a successfully built app at "gzip-app" Then the following files should exist: - | build/javascripts/test.js.gz | - | build/stylesheets/test.css.gz | + | build/index.html | | build/index.html.gz | | build/javascripts/test.js | + | build/javascripts/test.js.gz | | build/stylesheets/test.css | - | build/index.html | + | build/stylesheets/test.css.gz | When I run `file build/javascripts/test.js.gz` Then the output should contain "gzip" @@ -18,4 +18,19 @@ Feature: GZIP assets during build Then I should see "test_function" When I go to "/stylesheets/test.css" Then I should see "test_selector" - \ No newline at end of file + + Scenario: Only specified extensions should be gzipped + Given a fixture app "gzip-app" + And a file named "config.rb" with: + """ + activate :gzip, exts: %w(.js .html .htm) + """ + And a successfully built app at "gzip-app" + Then the following files should exist: + | build/index.html | + | build/index.html.gz | + | build/javascripts/test.js | + | build/javascripts/test.js.gz | + | build/stylesheets/test.css | + And the following files should not exist: + | build/stylesheets/test.css.gz |