Skip to content

Instantly share code, notes, and snippets.

@adrienthebo
Created January 18, 2019 00:57
Show Gist options
  • Save adrienthebo/c20ebae613a25e5499a9ab673df6a3ea to your computer and use it in GitHub Desktop.
Save adrienthebo/c20ebae613a25e5499a9ab673df6a3ea to your computer and use it in GitHub Desktop.
control 'project-bindings' do
projects.each do |project|
describe command("gcloud projects get-iam-policy #{project} --format='json(bindings)'") do
its('exit_status') { should eq 0 }
its('stderr') { should eq '' }
let(:members) do
bindings = JSON.parse(subject.stdout, symbolize_names: true)[:bindings]
bindings.find { |b| b[:'role'] == projectRoles[0] }[:members]
end
it { expect(members).to include(*memberGroups[0]) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment