shellutils 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/shellutils.rb +4 -0
- data/lib/shellutils/version.rb +1 -1
- data/spec/shellutils_spec.rb +13 -7
- metadata +1 -1
data/lib/shellutils.rb
CHANGED
data/lib/shellutils/version.rb
CHANGED
data/spec/shellutils_spec.rb
CHANGED
@@ -4,19 +4,25 @@ require 'tempfile'
|
|
4
4
|
module ShellUtils
|
5
5
|
describe ShellUtils do
|
6
6
|
describe ".sh" do
|
7
|
-
it "exec shell command" do
|
7
|
+
it "should exec shell command" do
|
8
8
|
ShellUtils.sh "pwd"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe ".sudo" do
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
it "should exec shell command" do
|
14
|
+
ShellUtils.sudo "pwd"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe ".current_user" do
|
19
|
+
it "should get current user" do
|
20
|
+
ShellUtils.current_user.should == `whoami`.chomp
|
21
|
+
end
|
16
22
|
end
|
17
23
|
|
18
|
-
describe ".
|
19
|
-
it "add config
|
24
|
+
describe ".add_config" do
|
25
|
+
it "should add config" do
|
20
26
|
config_text = <<-EOF
|
21
27
|
config1=value1
|
22
28
|
config2=value2
|
@@ -29,7 +35,7 @@ config2=value2
|
|
29
35
|
tf.close!
|
30
36
|
end
|
31
37
|
|
32
|
-
it "overwrite config
|
38
|
+
it "should overwrite config if already exists" do
|
33
39
|
config_text = <<-EOF
|
34
40
|
config3=value3
|
35
41
|
config4=value4
|