Sha256: 7e7920a0f524df3352c5b202136baf23975d469509e6a78e4d402e49a9832267

Contents?: true

Size: 660 Bytes

Versions: 40

Compression:

Stored size: 660 Bytes

Contents

module Awspec::Generator
  module Spec
    class CloudwatchEvent
      include Awspec::Helper::Finder
      def generate_all
        events = select_all_cloudwatch_events
        raise 'Not Found alarm' if events.empty?
        ERB.new(event_spec_template, nil, '-').result(binding).chomp
      end

      def event_spec_template
        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
        template
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
awspec-0.73.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.73.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.72.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.71.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.70.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.69.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.69.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.68.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.67.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.67.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.66.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.66.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.66.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.65.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.65.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.65.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.64.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.63.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.63.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-0.62.1 lib/awspec/generator/spec/cloudwatch_event.rb