From 9f561e97cb93a2ec6470e245f84f6080afab61fe Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 30 May 2010 07:02:07 -0700 Subject: [PATCH] [Command Line] Respect the --dry-run option during compilation. --- features/command_line.feature | 17 +++++++++++++++++ lib/compass/commands/update_project.rb | 10 +++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/features/command_line.feature b/features/command_line.feature index 217410e6..4db7d898 100644 --- a/features/command_line.feature +++ b/features/command_line.feature @@ -111,6 +111,23 @@ Feature: Command Line And a css file tmp_compass/tmp/reset.css is created And a css file tmp_compass/tmp/utilities.css is created + Scenario: Dry Run of Compiling an existing project. + Given I am using the existing project in test/fixtures/stylesheets/compass + When I run: compass compile --dry-run + Then a directory tmp/ is not created + And a sass file sass/layout.sass is reported compiled + And a sass file sass/print.sass is reported compiled + And a sass file sass/reset.sass is reported compiled + And a sass file sass/utilities.sass is reported compiled + And a css file tmp/layout.css is not created + And a css file tmp/print.css is not created + And a css file tmp/reset.css is not created + And a css file tmp/utilities.css is not created + And a css file tmp/layout.css is reported created + And a css file tmp/print.css is reported created + And a css file tmp/reset.css is reported created + And a css file tmp/utilities.css is reported created + Scenario: Recompiling a project with no changes Given I am using the existing project in test/fixtures/stylesheets/compass When I run: compass compile diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index 8b7ee130..24ebb190 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -46,12 +46,16 @@ module Compass end def new_compiler_instance(additional_options = {}) + compiler_opts = Compass.sass_engine_options + compiler_opts.merge!(:quiet => options[:quiet], + :force => options[:force], + :sass_files => explicit_sass_files, + :dry_run => options[:dry_run]) + compiler_opts.merge!(additional_options) Compass::Compiler.new(working_path, projectize(Compass.configuration.sass_dir), projectize(Compass.configuration.css_dir), - Compass.sass_engine_options.merge(:quiet => options[:quiet], - :force => options[:force], - :sass_files => explicit_sass_files).merge(additional_options)) + compiler_opts) end def explicit_sass_files