From 21c2b737f5fee5f46821b27f4dcae6f07f05dd35 Mon Sep 17 00:00:00 2001 From: Eliott Appleford Date: Sun, 6 Jul 2014 04:02:43 +0100 Subject: [PATCH] fix gzip spec --- middleman-core/features/gzip.feature | 4 +--- .../lib/middleman-core/step_definitions/builder_steps.rb | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/middleman-core/features/gzip.feature b/middleman-core/features/gzip.feature index 93955a49..18669476 100644 --- a/middleman-core/features/gzip.feature +++ b/middleman-core/features/gzip.feature @@ -1,4 +1,3 @@ -@nowindows Feature: GZIP assets during build Scenario: Built assets should be gzipped @@ -10,8 +9,7 @@ Feature: GZIP assets during build | build/javascripts/test.js.gz | | build/stylesheets/test.css | | build/stylesheets/test.css.gz | - When I run `file build/javascripts/test.js.gz` - Then the output should contain "gzip" + And build/javascripts/test.js.gz should be binary Scenario: Preview server doesn't change Given the Server is running at "gzip-app" diff --git a/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb b/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb index eda6467b..ce942284 100644 --- a/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb +++ b/middleman-core/lib/middleman-core/step_definitions/builder_steps.rb @@ -71,3 +71,7 @@ end Then /^the file "([^"]*)" should contain '([^']*)'$/ do |file, partial_content| check_file_content(file, partial_content, true) end + +And /(.*) should be binary/ do |file| + expect(File.binread(File.join(current_dir, file), 2)).to eq(['1F8B'].pack('H*')) +end