Sha256: beff458b5471763df82da5c55a5420222b82b7115f1fded96ab532a370c37a34

Contents?: true

Size: 660 Bytes

Versions: 113

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 event' 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

113 entries across 113 versions & 4 rubygems

Version Path
cthiesfork-awspec-1.2.2 lib/awspec/generator/spec/cloudwatch_event.rb
cthiesfork-awspec-1.2.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.5 lib/awspec/generator/spec/cloudwatch_event.rb
cthiesfork-awspec-1.2.0 lib/awspec/generator/spec/cloudwatch_event.rb
cthiesfork-awspec-1.1.0 lib/awspec/generator/spec/cloudwatch_event.rb
cthiesfork-awspec-1.0.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.4 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.3 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.18.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.17.4 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.17.3 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.17.2 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.17.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.17.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.16.1 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.16.0 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.15.3 lib/awspec/generator/spec/cloudwatch_event.rb
awspec-1.15.2 lib/awspec/generator/spec/cloudwatch_event.rb