spec/support/shared_matcher_examples.rb in serverspec-0.1.0 vs spec/support/shared_matcher_examples.rb in serverspec-0.1.1
- old
+ new
@@ -242,5 +242,21 @@
describe 'iptables' do
it { should_not have_iptables_rule('invalid-rule').with_table(table).with_chain(chain) }
end
end
end
+
+shared_examples_for 'support get_stdout matcher' do |command, output|
+ before :all do
+ RSpec.configure do |c|
+ c.stdout = "#{output}\r\n"
+ end
+ end
+
+ describe command do
+ it { should get_stdout output }
+ end
+
+ describe command do
+ it { should_not get_stdout 'invalid-output' }
+ end
+end