Add --force option to homesick rc command
Support automatically eval-ing .homesickrc file without prompting for user input. This is particularly useful for headless scripts that do not support user input.
This commit is contained in:
@@ -149,6 +149,26 @@ describe Homesick::CLI do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when options[:force] == true' do
|
||||
let(:homesick) { Homesick::CLI.new [], force: true }
|
||||
before do
|
||||
expect_any_instance_of(Thor::Shell::Basic).to_not receive(:yes?)
|
||||
end
|
||||
|
||||
it 'executes the .homesickrc' do
|
||||
castle.file('.homesickrc') do |file|
|
||||
file << "File.open(Dir.pwd + '/testing', 'w') do |f|
|
||||
f.print 'testing'
|
||||
end"
|
||||
end
|
||||
|
||||
expect(homesick).to receive(:say_status).with('eval', kind_of(Pathname))
|
||||
homesick.rc castle
|
||||
|
||||
expect(castle.join('testing')).to exist
|
||||
end
|
||||
end
|
||||
|
||||
context 'when told not to do so' do
|
||||
before do
|
||||
expect_any_instance_of(Thor::Shell::Basic).to receive(:yes?).with(be_a(String)).and_return(false)
|
||||
|
||||
Reference in New Issue
Block a user