Sha256: dd0d5023a5d9fa2f24f545b9641eac9fa93612e080f66f3ec2fe4e1208180ac9

Contents?: true

Size: 905 Bytes

Versions: 130

Compression:

Stored size: 905 Bytes

Contents

module Awspec::Generator
  module Spec
    class Efs
      include Awspec::Helper::Finder
      def generate_all
        file_systems = select_all_file_systems
        raise 'EFS not found' if file_systems.empty?
        specs = file_systems.map do |file_system|
          file_system.name = get_name_by_id(file_system.file_system_id)
          content = ERB.new(file_system_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
        end
        specs.join("\n")
      end

      def file_system_spec_template
        template = <<-'EOF'
describe efs('<%= file_system.name %>') do
  it { should exist }
  its(:number_of_mount_targets) { should eq <%= file_system.number_of_mount_targets %> }
  its(:life_cycle_state) { should eq '<%= file_system.life_cycle_state %>' }
  its(:performance_mode) { should eq '<%= file_system.performance_mode %>' }
end
EOF
        template
      end
    end
  end
end

Version data entries

130 entries across 130 versions & 4 rubygems

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