spec/debian/group_spec.rb in serverspec-0.6.22 vs spec/debian/group_spec.rb in serverspec-0.6.23
- old
+ new
@@ -1,8 +1,22 @@
require 'spec_helper'
include Serverspec::Helper::Debian
-describe 'Serverspec user matchers of Debian family' do
- it_behaves_like 'support group exist matcher', 'root'
- it_behaves_like 'support group have_gid matcher', 'root', 0
+describe group('root') do
+ it { should exist }
+ its(:command) { should eq "getent group | grep -wq -- root" }
end
+
+describe group('invalid-group') do
+ it { should_not exist }
+end
+
+describe group('root') do
+ it { should have_gid 0 }
+ its(:command) { should eq "getent group | grep -w -- \\^root | cut -f 3 -d ':' | grep -w -- 0" }
+end
+
+describe group('root') do
+ it { should_not have_gid 'invalid-gid' }
+end
+