Browse files

Added test and updated error message in case

of Bad Compass configuration file.

Closes gh-1.
  • Loading branch information...
1 parent 8ef8bd1 commit 21c2e7b55e0fe96399211a57af944bf1e49a46a2 @oliamb oliamb committed Oct 31, 2010
Showing with 22 additions and 1 deletion.
  1. +1 −1 lib/guard/compass.rb
  2. +21 −0 spec/guard/compass_spec.rb
View
2 lib/guard/compass.rb
@@ -69,7 +69,7 @@ def create_updater
::Compass.add_configuration filepath
options[:configuration_file] = filepath
else
- reporter.failure "Cannot find the Compass configuration file: " + filepath + "\nPlease check your configuration."
+ reporter.failure "Compass configuration file not found: " + filepath + "\nPlease check Guard configuration."
end
end
@updater = ::Compass::Commands::UpdateProject.new(@options[:workdir] , @options)
View
21 spec/guard/compass_spec.rb
@@ -163,6 +163,27 @@
end
end
+ describe "with a bad configuration file parameter" do
+ subject { Guard::Compass.new([], :configuration_file => 'invalid.rb') }
+
+ before :each do
+ create_fixture(:custom_config_file)
+ end
+
+ after :each do
+ subject.stop
+ remove_fixtures
+ end
+
+ it "reports an error" do
+ subject.options[:configuration_file].should == 'invalid.rb'
+ subject.reporter.stub!(:failure)
+ subject.reporter.should_receive(:failure).with("Compass configuration file not found: #{@project_path}/invalid.rb\nPlease check Guard configuration.")
+ subject.start
+ end
+
+ end
+
private
def create_fixture(name)
FileUtils.mkdir(TMP_PATH) if ! File.exists? TMP_PATH

0 comments on commit 21c2e7b

Please sign in to comment.