Class: Kelbim::Tester

Inherits:
Object
  • Object
show all
Defined in:
lib/kelbim/tester.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dsl) ⇒ Tester

of class methods



9
10
11
# File 'lib/kelbim/tester.rb', line 9

def initialize(dsl)
  @dsl = dsl
end

Class Method Details

.test(dsl) ⇒ Object



4
5
6
# File 'lib/kelbim/tester.rb', line 4

def test(dsl)
  self.new(dsl).test
end

Instance Method Details

#testObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kelbim/tester.rb', line 13

def test
  require 'rspec/autorun'

  @dsl.ec2s.each do |vpc, ec2|
    vpc ||= 'classic'

    ec2.load_balancers.each do |lb|
      if lb.spec
        RSpec.describe("#{vpc || :classic} > #{lb.name}") {
          it(&lb.spec)
        }
      end
    end
  end
end