Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
ViMesTor committed Dec 11, 2023
1 parent 3ce13ba commit 4e85841
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/services/chef_spec.rb
Original file line number Diff line number Diff line change
@@ -48,15 +48,17 @@
describe 'Registered in consul' do
serv_consul = 'erchef'
api_endpoint = 'http://localhost:8500/v1'
service_json_cluster = command("curl -s #{api_endpoint}/catalog/service/#{serv_consul} | jq -c 'group_by(.ID)[]'").stdout.chomp.split("\n")
health_cluster = command("curl -s #{api_endpoint}/health/service/#{serv_consul} | jq -r '.[].Checks[0].Status'").stdout.chomp.split("\n")
service_json_cluster = command("curl -s #{api_endpoint}/catalog/service/#{serv_consul} | jq -c 'group_by(.ID)[]'")
service_json_cluster = service_json_cluster.stdout.chomp.split("\n")
health_cluster = command("curl -s #{api_endpoint}/health/service/#{serv_consul} | jq -r '.[].Checks[0].Status'")
health_cluster = health_cluster.stdout.chomp.split("\n")
service_and_health = service_json_cluster.zip(health_cluster)
service_and_health.each do |service, health|
registered = JSON.parse(service)[0].key?('Address') && health == 'passing' # ? true : false
it 'Should be registered and enabled' do
expect(registered).to be true
end
end
end
end
end
end

0 comments on commit 4e85841

Please sign in to comment.