spec/support/shared_matcher_examples.rb in serverspec-0.2.26 vs spec/support/shared_matcher_examples.rb in serverspec-0.2.27
- old
+ new
@@ -716,10 +716,21 @@
it { should_not be_readable.by('others') }
end
end
end
+shared_examples_for 'support be_readable_by_specific_user matcher' do |file, user|
+ describe 'be_readable_by_specific_user' do
+ describe file do
+ it { should be_readable.by_user(user) }
+ end
+ describe file+'_invalid' do
+ it { should_not be_readable.by_user(user) }
+ end
+ end
+end
+
shared_examples_for 'support be_writable matcher' do |file|
describe 'be_writable' do
describe file do
before :all do
RSpec.configure do |c|
@@ -804,10 +815,21 @@
it { should_not be_writable.by('others') }
end
end
end
+shared_examples_for 'support be_writable_by_specific_user matcher' do |file, user|
+ describe 'be_writable_by_specific_user' do
+ describe file do
+ it { should be_writable.by_user(user) }
+ end
+ describe 'invalid-file' do
+ it { should_not be_writable.by_user(user) }
+ end
+ end
+end
+
shared_examples_for 'support be_executable matcher' do |file|
describe 'be_executable' do
describe file do
before :all do
RSpec.configure do |c|
@@ -888,9 +910,20 @@
RSpec.configure do |c|
c.stdout = "666\r\n"
end
end
it { should_not be_executable.by('others') }
+ end
+ end
+end
+
+shared_examples_for 'support be_executable_by_specific_user matcher' do |file, user|
+ describe 'be_writable_by_specific_user' do
+ describe file do
+ it { should be_executable.by_user(user) }
+ end
+ describe file+'_invalid' do
+ it { should_not be_executable.by_user(user) }
end
end
end
shared_examples_for 'support have_ipfilter_rule matcher' do |rule|