(v) ✘-1 13:45 ~/workspace/genesis [tests L|✚ 3…3126⚑ 1] $ bundle exec rspec
.F
Failures:
1) SparkleFormation compiles
Failure/Error: dynamic!(:vpc_subnet, 'foo')
RuntimeError:
Failed to locate requested dynamic block for insertion: vpc_subnet (valid: )
Builtin dynamics pattern `AWS::OpsWorks::App` -> `:aws_ops_works_app`
# ./spec/fixtures/sfn/vpc_subnet_foo.rb:2:in `block in compile'
# ./spec/unit/sparkleformation/dynamics/vpc_spec.rb:11:in `block (2 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# SparkleFormation::Error::NotFound::Dynamic:
# Failed to locate item named: `vpc_subnet`
# ./spec/fixtures/sfn/vpc_subnet_foo.rb:2:in `block in compile'
Finished in 0.04821 seconds (files took 0.10017 seconds to load)
2 examples, 1 failure
Failed examples:
rspec ./spec/unit/sparkleformation/dynamics/vpc_spec.rb:10 # SparkleFormation compiles
(v) ✘-1 13:45 ~/workspace/genesis [tests L|✚ 3…3126⚑ 1] $
My directory layout looks like:
(v) ✔ 13:47 ~/workspace/genesis [tests L|✚ 3…3125⚑ 1] $ find spec -type f -follow
spec/fixtures/sfn/dynamics/vpc.rb
spec/fixtures/sfn/vpc_subnet_foo.rb
spec/spec_helper.rb
spec/unit/sparkleformation/dynamics/vpc_spec.rb
(v) ✔ 13:47 ~/workspace/genesis [tests L|✚ 3…3124⚑ 1] $
Tests look like:
(v) ✘-1 13:48 ~/workspace/genesis [tests L|✚ 3…3125⚑ 1] $ cat spec/unit/sparkleformation/dynamics/vpc_spec.rb
require 'sparkle_formation'
describe SparkleFormation do
before do
SparkleFormation.sparkle_path = File.join(File.dirname(__FILE__), '../../../fixtures/sfn')
end
it { expect(1).to eq 1}
it 'compiles' do
SparkleFormation.compile('vpc_subnet_foo.rb')
end
end
(v) ✔ 13:49 ~/workspace/genesis [tests L|✚ 3…3125⚑ 1] $
It’s definite that the sparkle_path is set to the correct directory.
And finally the fixture template looks like this:
(v) ✔ 13:52 ~/workspace/genesis [tests L|✚ 3…3125⚑ 1] $ cat spec/fixtures/sfn/vpc_subnet_foo.rb
SparkleFormation.new(:vpc_subnet_foo, provider: :aws) do
dynamic!(:vpc_subnet, 'foo')
end
(v) ✔ 13:53 ~/workspace/genesis [tests L|✚ 3…3125⚑ 1] $
Is there something else I need to do to get loading the dynamics working?
Thanks,
-Jesse