Sha256: 223893cc00a7827f556e1bcbd0bd7ab5d9422af6875a80b11b1026dd84c9c0d9
Contents?: true
Size: 687 Bytes
Versions: 12
Compression:
Stored size: 687 Bytes
Contents
require 'test_helper' require 'json' class TestTrust < Minitest::Test def setup @template = ::Convection.template do description 'Trust Test Template' iam_role 'FooRole' do trust_service 'bar' end end end def from_json JSON.parse(@template.to_json) end def test_trust json = from_json['Resources']['FooRole']['Properties'] doc = json['AssumeRolePolicyDocument'] refute doc.nil?, 'No policy document present in JSON' stmt = doc['Statement'] trust_bar = stmt.any? { |s| s['Principal']['Service'] == 'bar.amazonaws.com' } assert_equal true, trust_bar, 'Expected to find [bar.amazonaws.com] in document' end end
Version data entries
12 entries across 12 versions & 1 rubygems