Merge pull request #166 from MainShayne233/master
Enhancement/Add 'to' to error message.
This commit is contained in:
@@ -37,7 +37,7 @@ module Homesick
|
|||||||
def check_castle_existance(name, action)
|
def check_castle_existance(name, action)
|
||||||
return if castle_dir(name).exist?
|
return if castle_dir(name).exist?
|
||||||
say_status :error,
|
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
|
:red
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ describe Homesick::CLI do
|
|||||||
it 'prints an error message when trying to pull a non-existant castle' do
|
it 'prints an error message when trying to pull a non-existant castle' do
|
||||||
expect(homesick).to receive('say_status').once
|
expect(homesick).to receive('say_status').once
|
||||||
.with(:error,
|
.with(:error,
|
||||||
/Could not pull castle_repo, expected .* exist and contain dotfiles/,
|
/Could not pull castle_repo, expected .* to exist and contain dotfiles/,
|
||||||
:red)
|
:red)
|
||||||
expect { homesick.pull 'castle_repo' }.to raise_error(SystemExit)
|
expect { homesick.pull 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
@@ -529,7 +529,7 @@ describe Homesick::CLI do
|
|||||||
|
|
||||||
it 'prints an error message when trying to push a non-existant castle' do
|
it 'prints an error message when trying to push a non-existant castle' do
|
||||||
expect(homesick).to receive('say_status').once
|
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)
|
expect { homesick.push 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -687,7 +687,7 @@ describe Homesick::CLI do
|
|||||||
|
|
||||||
it 'returns an error message when the given castle does not exist' do
|
it 'returns an error message when the given castle does not exist' do
|
||||||
expect(homesick).to receive('say_status').once
|
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)
|
expect { homesick.cd 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -716,7 +716,7 @@ describe Homesick::CLI do
|
|||||||
# Set a default just in case none is set
|
# Set a default just in case none is set
|
||||||
allow(ENV).to receive(:[]).with('EDITOR').and_return('vim')
|
allow(ENV).to receive(:[]).with('EDITOR').and_return('vim')
|
||||||
allow(homesick).to receive('say_status').once
|
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)
|
expect { homesick.open 'castle_repo' }.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user