spec/command_spec.rb in vagrant-shell-commander-0.1.1 vs spec/command_spec.rb in vagrant-shell-commander-0.1.2

- old
+ new

@@ -65,11 +65,11 @@ end end context 'running machine' do let(:cmd) {'command'} - let(:cwd) {'cwd'} + let(:dir) {'dir'} let(:communicate) {double(execute: true)} before(:each) do VagrantShellCommander::OptionManager.stub_chain(:new, :execute). and_return(parser: 'parser', values: {cmd: cmd}) @@ -85,32 +85,33 @@ it 'shows the command output along with the machine name' do data = 'data' communicate.stub(:execute).and_yield('type', data) - ui.should_receive(:info).with("#{machine_name}:: #{data}") + ui.should_receive(:success).with("#{machine_name}::") + ui.should_receive(:info).with(data) end - it 'executes the command in the given cwd' do + it 'executes the command in the given dir' do VagrantShellCommander::OptionManager.stub_chain(:new, :execute). - and_return(parser: 'parser', values: {cmd: cmd, cwd: cwd}) + and_return(parser: 'parser', values: {cmd: cmd, dir: dir}) - communicate.should_receive(:execute).with("cd #{cwd} && #{cmd}") + communicate.should_receive(:execute).with("cd #{dir} && #{cmd}") end describe 'does nothing' do after(:each) do subject.should_not_receive(:with_target_vms) end it 'an empty command' do VagrantShellCommander::OptionManager.stub_chain(:new, :execute). - and_return(parser: 'parser', values: {cmd: '', cwd: cwd}) + and_return(parser: 'parser', values: {cmd: '', dir: dir}) end it 'non present command' do VagrantShellCommander::OptionManager.stub_chain(:new, :execute). - and_return(parser: 'parser', values: {cwd: cwd}) + and_return(parser: 'parser', values: {dir: dir}) end end end end end