spec/lib/mina/commands_spec.rb in mina-1.0.0.beta2 vs spec/lib/mina/commands_spec.rb in mina-1.0.0.beta3
- old
+ new
@@ -16,10 +16,11 @@
expect(commands.queue[:default]).to include(' ls -al')
end
context 'when verbose' do
before { Mina::Configuration.instance.set(:verbose, true) }
+ after { Mina::Configuration.instance.remove(:verbose) }
it 'adds a echo command to the queue' do
commands.command('ls -al')
expect(commands.queue[:default]).to include("echo \\$\\ ls\\ -al &&\nls -al")
@@ -70,24 +71,22 @@
expect(commands.process('some/path')).to eq('(cd some/path && ls -al && pwd)')
end
context 'when verbose' do
before { Mina::Configuration.instance.set(:verbose, true) }
+ after { Mina::Configuration.instance.remove(:verbose) }
it 'joins all the commands within a path and echoes it' do
- expect(commands.process('some/path')).to eq("(cd some/path && echo '$ cd some/path' && ls -al && pwd)")
+ expect(commands.process('some/path')).to eq("(cd some/path && echo \"$ cd some/path\" && ls -al && pwd)")
end
end
end
describe '#run' do
- before do
+ it 'calls run on a backend' do
runner = double(:runner)
allow(Mina::Runner).to receive(:new).and_return(runner)
- allow(runner).to receive(:run).and_return(:ran)
- end
-
- it 'calls run on a backend' do
- expect(commands.run(:local)).to eq(:ran)
+ expect(runner).to receive(:run).and_return(true)
+ commands.run(:local)
end
end
end