Sha256: 1efeb09b8ab469f3ac2a46380ad2dcdbb7a5dcfc1c54892e9256dea441754525
Contents?: true
Size: 1.21 KB
Versions: 68
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' class Convection::Model::Template::Resource describe EventsRule do let(:template) do Convection.template do description 'EventsRule Test Template' # TODO: Test simple properties of EventsRule as well? events_rule 'MyEventsRule' do event_pattern 'source', %w(aws.ec2) event_pattern 'detail', 'state' => %w(shutting-down stopped stopping terminated), 'instance-id' => 'i-deadb33f' event_pattern 'detail-type', ['EC2 Instance State-change Notification'] end end end subject do template_json .fetch('Resources') .fetch('MyEventsRule') .fetch('Properties') end it 'combines all event pattern calls into a single event pattern JSON object' do expect(subject['EventPattern']).to include( 'source' => %w(aws.ec2), 'detail' => { 'state' => %w(shutting-down stopped stopping terminated), 'instance-id' => 'i-deadb33f' }, 'detail-type' => ['EC2 Instance State-change Notification'] ) end private def template_json JSON.parse(template.to_json) end end end
Version data entries
68 entries across 68 versions & 1 rubygems