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



15
16
17
# File 'lib/kelbim/tester.rb', line 15

def initialize(dsl)
  @dsl = dsl
end

Class Method Details

.test(dsl) ⇒ Object



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

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

Instance Method Details

#testObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/kelbim/tester.rb', line 19

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