Sha256: 0deebd4082951a64fbbcdb35cf7b16ddc6d0a70545f517659f0b667e665723d6

Contents?: true

Size: 664 Bytes

Versions: 12

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

module Awspec::Generator
  module Spec
    class CloudwatchEvent
      include Awspec::Helper::Finder
      def generate_all
        events = select_all_cloudwatch_events
        raise 'Not Found event' if events.empty?

        ERB.new(event_spec_template, nil, '-').result(binding).chomp
      end

      def event_spec_template
        <<-'EOF'
<% events.each do |event| %>
describe cloudwatch_event('<%= event.name %>') do
  it { should exist }
<%- if event.state == 'ENABLED' -%>
  it { should be_enable }
<% end -%>
  it { should be_scheduled('<%= event.schedule_expression %>') }
end
<% end %>
EOF
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
awspec-1.30.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.29.3 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.29.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.29.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.29.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.28.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.28.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.28.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.27.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.27.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.26.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.25.2 lib/awspec/generator/spec/cloudwatch_event.rb