spec/gentoo/commands_spec.rb in serverspec-0.2.19 vs spec/gentoo/commands_spec.rb in serverspec-0.2.20
- old
+ new
@@ -8,9 +8,29 @@
describe 'check_file', :os => :gentoo do
subject { commands.check_file('/etc/passwd') }
it { should eq 'test -f /etc/passwd' }
end
+describe 'check_mounted', :os => :debian do
+ subject { commands.check_mounted('/') }
+ it { should eq "mount | grep -w 'on /'" }
+end
+
+describe 'check_resolvable', :os => :debian do
+ context "resolve localhost by hosts" do
+ subject { commands.check_resolvable('localhost', 'hosts') }
+ it { should eq "grep -w localhost /etc/hosts" }
+ end
+ context "resolve localhost by dns" do
+ subject { commands.check_resolvable('localhost', 'dns') }
+ it { should eq "nslookup -timeout=1 localhost" }
+ end
+ context "resolve localhost with default settings" do
+ subject { commands.check_resolvable('localhost',nil) }
+ it { should eq 'getent hosts localhost' }
+ end
+end
+
describe 'check_directory', :os => :gentoo do
subject { commands.check_directory('/var/log') }
it { should eq 'test -d /var/log' }
end