spec/support/shared_matcher_examples.rb in serverspec-0.0.6 vs spec/support/shared_matcher_examples.rb in serverspec-0.0.7
- old
+ new
@@ -104,5 +104,41 @@
describe 'we_are_dummy_group' do
it { should_not be_group }
end
end
end
+
+shared_examples_for 'support be_mode matcher' do |valid_file, mode|
+ describe 'be_mode' do
+ describe valid_file do
+ it { should be_mode mode }
+ end
+
+ describe '/etc/passwd' do
+ it { should_not be_mode 000 }
+ end
+ end
+end
+
+shared_examples_for 'support be_owned_by matcher' do |valid_file, owner|
+ describe 'be_owned_by' do
+ describe valid_file do
+ it { should be_owned_by owner }
+ end
+
+ describe '/etc/passwd' do
+ it { should_not be_owned_by 'daemon' }
+ end
+ end
+end
+
+shared_examples_for 'support be_grouped_into matcher' do |valid_file, group|
+ describe 'be_grouped_into' do
+ describe valid_file do
+ it { should be_grouped_into grouped }
+ end
+
+ describe '/etc/passwd' do
+ it { should_not be_grouped_into 'daemon' }
+ end
+ end
+end