2015-09-05 17:04:19 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
require 'helper'
|
|
|
|
require 'vulcano/resource'
|
|
|
|
|
|
|
|
describe 'Vulcano::Resources::Passwd' do
|
2015-09-22 16:31:21 +00:00
|
|
|
let(:resource) { load_resource('passwd') }
|
2015-09-05 17:04:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'verify passwd parsing' do
|
|
|
|
_(resource.usernames).must_equal %w{root www-data}
|
|
|
|
_(resource.uids).must_equal %w{0 33}
|
|
|
|
end
|
2015-09-05 17:04:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'verify root passwd resource' do
|
|
|
|
root = resource.uid(0)
|
|
|
|
_(root.username).must_equal 'root'
|
|
|
|
_(root.count).must_equal 1
|
|
|
|
end
|
2015-09-05 17:04:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'verify www-data resource' do
|
|
|
|
www = resource.uid(33)
|
|
|
|
_(www.username).must_equal 'www-data'
|
|
|
|
_(www.count).must_equal 1
|
2015-09-05 17:04:19 +00:00
|
|
|
end
|
|
|
|
end
|