github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/search_spec.rb (about)

     1  # Inspec tests for the search chef api go module
     2  #
     3  
     4  describe command('/go/src/github.com/go-chef/chef/testapi/bin/search') do
     5    its('stderr') { should match(/^Issue building invalid query statement is malformed/) }
     6    its('stderr') { should_not match(/node/) }
     7    its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) }
     8    its('stdout') do
     9      should match(%r{^List indexes map\[(?=.*node:https://testhost/organizations/test/search/node)(?=.*role:https://testhost/organizations/test/search/role)(?=.*client:https://testhost/organizations/test/search/client)(?=.*environment:https://testhost/organizations/test/search/environment).*\] EndIndex})
    10    end
    11    its('stdout') { should match(/^List new query node\?q=name:node\*&rows=2&sort=X_CHEF_id_CHEF_X asc&start=0/) }
    12    its('stdout') { should match(/^List nodes from query \{Total:2 Start:0 Rows:\[/) }
    13    its('stdout') { should match(/^List nodes from Exec query \{Total:1 Start:0 Rows:\[/) }
    14    its('stdout') { should match(/^List nodes from all nodes Exec query \{Total:4 Start:0 Rows:\[/) }
    15    its('stdout') { should match(/^List nodes from partial search \{Total:4 Start:0 Rows:\[/) }
    16    its('stdout') { should match(/^List nodes from query JSON format \{Total:2 Start:0 Rows:\[/) }
    17    its('stdout') { should match(/^List 2nd set of nodes from query JSON format \{Total:2 Start:0 Rows:\[/) }
    18    its('stdout') { should match(/^List nodes from Exec query JSON format \{Total:1 Start:0 Rows:\[/) }
    19    its('stdout') { should match(/^List nodes from all nodes Exec query JSON format \{Total:4 Start:0 Rows:\[/) }
    20    its('stdout') { should match(/^Partial search JSON format row: 0 rawjson: {"name":"node0"}/) }
    21  end