From ae343c4cabdcf359e1631adc55418c79f3fb6274 Mon Sep 17 00:00:00 2001 From: Shayne Tremblay Date: Sat, 2 Sep 2017 13:06:46 -0700 Subject: [PATCH] Add 'to' to error message. --- lib/homesick/utils.rb | 2 +- spec/homesick_cli_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/homesick/utils.rb b/lib/homesick/utils.rb index 56bde02..701ec2a 100644 --- a/lib/homesick/utils.rb +++ b/lib/homesick/utils.rb @@ -37,7 +37,7 @@ module Homesick def check_castle_existance(name, action) return if castle_dir(name).exist? say_status :error, - "Could not #{action} #{name}, expected #{castle_dir(name)} exist and contain dotfiles", + "Could not #{action} #{name}, expected #{castle_dir(name)} to exist and contain dotfiles", :red exit(1) end diff --git a/spec/homesick_cli_spec.rb b/spec/homesick_cli_spec.rb index 80c12a2..31fcfb4 100644 --- a/spec/homesick_cli_spec.rb +++ b/spec/homesick_cli_spec.rb @@ -499,7 +499,7 @@ describe Homesick::CLI do it 'prints an error message when trying to pull a non-existant castle' do expect(homesick).to receive('say_status').once .with(:error, - /Could not pull castle_repo, expected .* exist and contain dotfiles/, + /Could not pull castle_repo, expected .* to exist and contain dotfiles/, :red) expect { homesick.pull 'castle_repo' }.to raise_error(SystemExit) end @@ -529,7 +529,7 @@ describe Homesick::CLI do it 'prints an error message when trying to push a non-existant castle' do expect(homesick).to receive('say_status').once - .with(:error, /Could not push castle_repo, expected .* exist and contain dotfiles/, :red) + .with(:error, /Could not push castle_repo, expected .* to exist and contain dotfiles/, :red) expect { homesick.push 'castle_repo' }.to raise_error(SystemExit) end end @@ -687,7 +687,7 @@ describe Homesick::CLI do it 'returns an error message when the given castle does not exist' do expect(homesick).to receive('say_status').once - .with(:error, /Could not cd castle_repo, expected .* exist and contain dotfiles/, :red) + .with(:error, /Could not cd castle_repo, expected .* to exist and contain dotfiles/, :red) expect { homesick.cd 'castle_repo' }.to raise_error(SystemExit) end end @@ -716,7 +716,7 @@ describe Homesick::CLI do # Set a default just in case none is set allow(ENV).to receive(:[]).with('EDITOR').and_return('vim') allow(homesick).to receive('say_status').once - .with(:error, /Could not open castle_repo, expected .* exist and contain dotfiles/, :red) + .with(:error, /Could not open castle_repo, expected .* to exist and contain dotfiles/, :red) expect { homesick.open 'castle_repo' }.to raise_error(SystemExit) end end