inspec/test/integration/default/compare_matcher_spec.rb

38 lines
869 B
Ruby
Raw Normal View History

# encoding: utf-8
2016-01-28 13:51:54 +00:00
if os.linux?
# uses the `cmp` matcher instead of the eq matcher
describe sshd_config do
its('Port') { should eq '22' }
its('Port') { should_not eq 22 }
2016-01-28 13:51:54 +00:00
its('Port') { should cmp '22' }
its('Port') { should cmp 22 }
its('Port') { should cmp 22.0 }
its('Port') { should_not cmp 22.1 }
2016-01-28 13:51:54 +00:00
its('LogLevel') { should eq 'INFO' }
its('LogLevel') { should_not eq 'info'}
2016-01-28 13:51:54 +00:00
its('LogLevel') { should cmp 'INFO' }
its('LogLevel') { should cmp 'info' }
its('LogLevel') { should cmp 'InfO' }
end
2016-02-18 11:08:57 +00:00
describe passwd.passwords.uniq do
it { should eq ['x'] }
it { should cmp ['x'] }
it { should cmp 'x' }
end
describe passwd.usernames do
it { should include 'root' }
it { should_not cmp 'root' }
end
2016-02-23 21:31:10 +00:00
len = passwd.passwords.length
describe len do
it { should cmp len.to_s }
end
end