vagrant-shell-commander 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/vagrant-shell-commander/command.rb +3 -2
- data/lib/vagrant-shell-commander/version.rb +1 -1
- data/spec/command_spec.rb +8 -7
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -35,8 +35,9 @@ module VagrantShellCommander
|
|
35
35
|
|
36
36
|
machine.communicate.
|
37
37
|
execute(add_cwd_to_command(cli_options[:values][:cmd],
|
38
|
-
cli_options[:values][:
|
39
|
-
env.ui.
|
38
|
+
cli_options[:values][:dir])) do |type, data|
|
39
|
+
env.ui.success("#{machine.name}::")
|
40
|
+
env.ui.info(data)
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
data/spec/command_spec.rb
CHANGED
@@ -67,7 +67,7 @@ describe VagrantShellCommander::Command do
|
|
67
67
|
|
68
68
|
context 'running machine' do
|
69
69
|
let(:cmd) {'command'}
|
70
|
-
let(:
|
70
|
+
let(:dir) {'dir'}
|
71
71
|
let(:communicate) {double(execute: true)}
|
72
72
|
|
73
73
|
before(:each) do
|
@@ -87,14 +87,15 @@ describe VagrantShellCommander::Command do
|
|
87
87
|
|
88
88
|
communicate.stub(:execute).and_yield('type', data)
|
89
89
|
|
90
|
-
ui.should_receive(:
|
90
|
+
ui.should_receive(:success).with("#{machine_name}::")
|
91
|
+
ui.should_receive(:info).with(data)
|
91
92
|
end
|
92
93
|
|
93
|
-
it 'executes the command in the given
|
94
|
+
it 'executes the command in the given dir' do
|
94
95
|
VagrantShellCommander::OptionManager.stub_chain(:new, :execute).
|
95
|
-
and_return(parser: 'parser', values: {cmd: cmd,
|
96
|
+
and_return(parser: 'parser', values: {cmd: cmd, dir: dir})
|
96
97
|
|
97
|
-
communicate.should_receive(:execute).with("cd #{
|
98
|
+
communicate.should_receive(:execute).with("cd #{dir} && #{cmd}")
|
98
99
|
end
|
99
100
|
|
100
101
|
describe 'does nothing' do
|
@@ -104,12 +105,12 @@ describe VagrantShellCommander::Command do
|
|
104
105
|
|
105
106
|
it 'an empty command' do
|
106
107
|
VagrantShellCommander::OptionManager.stub_chain(:new, :execute).
|
107
|
-
and_return(parser: 'parser', values: {cmd: '',
|
108
|
+
and_return(parser: 'parser', values: {cmd: '', dir: dir})
|
108
109
|
end
|
109
110
|
|
110
111
|
it 'non present command' do
|
111
112
|
VagrantShellCommander::OptionManager.stub_chain(:new, :execute).
|
112
|
-
and_return(parser: 'parser', values: {
|
113
|
+
and_return(parser: 'parser', values: {dir: dir})
|
113
114
|
end
|
114
115
|
end
|
115
116
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-shell-commander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|