github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/databag_spec.rb (about) 1 # Inspec tests for the databag chef api go module 2 # 3 4 describe command('/go/src/github.com/go-chef/chef/testapi/bin/databag') do 5 its('stderr') { should match(%r{^Issue recreating databag1. POST https://testhost/organizations/test/data: 409}) } 6 its('stderr') { should match(/^Issue recreating databag1. 409/) } 7 its('stderr') { should match(%r{^Issue getting nothere. GET https://testhost/organizations/test/data/nothere: 404}) } 8 its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) } 9 its('stdout') { should match(/Missing data bag. Code 404/) } 10 its('stdout') { should match(/Missing data bag. Msg Cannot load data bag nothere/) } 11 its('stdout') { should match(/Missing data bag. Text \{"error":\["Cannot load data bag nothere"\]\}/) } 12 its('stdout') { should match(/^List initial databags\s*$/) } 13 its('stdout') { should match(%r{^Added databag1 &\{https://testhost/organizations/test/data/databag1\}}) } 14 its('stdout') do 15 should match(%r{^List databags after adding databag1 databag1 => https://testhost/organizations/test/data/databag1}) 16 end 17 its('stdout') { should match(/^Create databag1::item1 <nil>/) } 18 its('stdout') { should match(/^Update databag1::item1 <nil>/) } 19 its('stdout') do 20 should match(%r{^List databag1 items item1 => https://testhost/organizations/test/data/databag1/item1}) 21 end 22 its('stdout') { should match(/^Get databag1::item1 map\[(?=.*id:item1)(?=.*type:password)(?=.*value:next).*\]/) } 23 its('stdout') { should match(/^Delete databag1::item1 <nil>/) } 24 its('stdout') { should match(/^List databag1 items after delete/) } 25 its('stdout') { should match(/^Delete databag1 &\{Name:databag1 JsonClass:Chef::DataBag ChefType:data_bag/) } 26 its('stdout') { should match(/^List databags after cleanup\s*$/) } 27 end