github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/role_spec.rb (about) 1 # Inspec tests for the role chef api go module 2 # 3 4 describe command('/go/src/github.com/go-chef/chef/testapi/bin/role') do 5 its('stderr') { should match(%r{^Issue recreating role1: POST https://testhost/organizations/test/roles: 409}) } 6 its('stderr') { should match(/^Issue recreating role1: 409/) } 7 its('stderr') { should match(%r{^Issue getting nothere: GET https://testhost/organizations/test/roles/nothere: 404}) } 8 its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) } 9 its('stdout') { should match(%r{^Added role1 uri => https://testhost/organizations/test/roles/role1}) } 10 its('stdout') { should match(%r{^Added roleNR uri => https://testhost/organizations/test/roles/roleNR}) } 11 its('stdout') do 12 should match(%r{^List roles after adding role1 role1 => https://testhost/organizations/test/roles/role1}) 13 end 14 its('stdout') do 15 should match(/^Get role1 &\{Name:role1 ChefType:role DefaultAttributes:map\[(?=.*git_repo:here.git)(?=.*users:\[root moe\]).*\] Description:Test role EnvRunList:map\[(?=.*en2:\[recipe\[foo2\]\]).*(?=.*en1:\[recipe\[foo1\] recipe\[foo2\]\]).*JsonClass:Chef::Role OverrideAttributes:map\[env:map\[(?=.*mine:ample)(?=.*yours:full).*\]\] RunList:\[recipe\[foo\] recipe\[baz\] role\[banana\]\]\}/) 16 end 17 its('stdout') do 18 should match(/^Update role1 &\{Name:role1 ChefType:role DefaultAttributes:map\[(?=.*git_repo:here.git)(?=.*users:\[root moe\]).*\] Description:Changed Role EnvRunList:map\[(?=.*en1:\[recipe\[foo1\] recipe\[foo2\]\]).*(?=.*en2:\[recipe\[foo2\]\]).*JsonClass:Chef::Role OverrideAttributes:map\[env:map\[(?=.*mine:ample)(?=.*yours:full).*\]\] RunList:\[recipe\[foo\] recipe\[baz\] role\[banana\]\]\}/) 19 end 20 its('stdout') { should match(/^Environments for role1 \[_default en1 en2\]/) } 21 its('stdout') { should match(/^Environments for role1 map\[run_list:\[recipe\[foo1\] recipe\[foo2\]\]\]/) } 22 its('stdout') { should match(/^Delete role1 <nil>/) } 23 its('stdout') { should match(/^List roles after cleanup.*/) } 24 end