github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/organization_spec.rb (about) 1 # Inspec tests for the organization chef api go module 2 # 3 4 describe command('/go/src/github.com/go-chef/chef/testapi/bin/organization') do 5 its('stderr') do 6 should match(%r{^Issue creating org: {org1 organization1 } POST https://testhost/organizations: 409$}) 7 end 8 its('stderr') { should match(/^Issue creating org: {org1 organization1 } 409$/) } 9 its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) } 10 its('stdout') { should match(/^List initial organizations map\[test.*test\]$/) } 11 its('stdout') { should match(/^Added org1 {org1-validator -----BEGIN RSA PRIVATE KEY-----/) } 12 its('stdout') { should match(/^Added org1 again { }$/) } 13 its('stdout') { should match(/^Added org2 {org2-validator -----BEGIN RSA PRIVATE KEY-----.*$/) } 14 its('stdout') { should match(/^Get org1 {org1 organization1 [0-9a-f]+}$/) } 15 its('stdout') do 16 should match(%r{^List organizations After adding org1 and org2 map(?=.*org2:https://testhost/organizations/org2)(?=.*test:https://testhost/organizations/test)(?=.*org1:https://testhost/organizations/org1)}) 17 end 18 its('stdout') { should match(/^Update org1 {org1 new_organization1 }/) } 19 its('stdout') { should match(/^Get org1 after update {org1 new_organization1 [0-9a-f]+}/) } 20 its('stdout') { should match(/^Delete org2 <nil>/) } 21 its('stdout') do 22 should match(%r{^List organizations after deleting org2 map(?=.*test:https://testhost/organizations/test)(?=.*org1:https://testhost/organizations/org1)}) 23 end 24 its('stdout') { should match(/^Result from deleting org1 <nil>/) } 25 its('stdout') { should match(%r{^List organizations after cleanup map\[test:https://testhost/organizations/test\]}) } 26 end