serverspec 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/serverspec/matchers/get_stdout.rb +6 -0
- data/lib/serverspec/matchers.rb +1 -0
- data/lib/serverspec/version.rb +1 -1
- data/spec/debian/matchers_spec.rb +1 -0
- data/spec/gentoo/matchers_spec.rb +1 -0
- data/spec/redhat/matchers_spec.rb +2 -0
- data/spec/solaris/matchers_spec.rb +1 -0
- data/spec/support/shared_matcher_examples.rb +16 -0
- metadata +3 -2
data/lib/serverspec/matchers.rb
CHANGED
data/lib/serverspec/version.rb
CHANGED
@@ -31,4 +31,5 @@ describe 'Serverspec matchers of Debian family', :os => :debian do
|
|
31
31
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
32
32
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
33
33
|
|
34
|
+
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
34
35
|
end
|
@@ -32,4 +32,5 @@ describe 'Serverspec matchers of Gentoo family', :os => :gentoo do
|
|
32
32
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
33
33
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
34
34
|
|
35
|
+
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
35
36
|
end
|
@@ -31,4 +31,6 @@ describe 'Serverspec matchers of Red Hat family', :os => :redhat do
|
|
31
31
|
|
32
32
|
it_behaves_like 'support have_iptables_rule matcher', '-P INPUT ACCEPT'
|
33
33
|
it_behaves_like 'support have_iptables_rule.with_table.with_chain matcher', '-P INPUT ACCEPT', 'mangle', 'INPUT'
|
34
|
+
|
35
|
+
it_behaves_like 'support get_stdout matcher', 'whoami', 'root'
|
34
36
|
end
|
@@ -244,3 +244,19 @@ shared_examples_for 'support have_iptables_rule.with_table.with_chain matcher' d
|
|
244
244
|
end
|
245
245
|
end
|
246
246
|
end
|
247
|
+
|
248
|
+
shared_examples_for 'support get_stdout matcher' do |command, output|
|
249
|
+
before :all do
|
250
|
+
RSpec.configure do |c|
|
251
|
+
c.stdout = "#{output}\r\n"
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
describe command do
|
256
|
+
it { should get_stdout output }
|
257
|
+
end
|
258
|
+
|
259
|
+
describe command do
|
260
|
+
it { should_not get_stdout 'invalid-output' }
|
261
|
+
end
|
262
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/serverspec/matchers/be_user.rb
|
115
115
|
- lib/serverspec/matchers/belong_to_group.rb
|
116
116
|
- lib/serverspec/matchers/contain.rb
|
117
|
+
- lib/serverspec/matchers/get_stdout.rb
|
117
118
|
- lib/serverspec/matchers/have_cron_entry.rb
|
118
119
|
- lib/serverspec/matchers/have_iptables_rule.rb
|
119
120
|
- lib/serverspec/setup.rb
|