You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node.default['base']['packages'] = %w(telnet jq)
node['base']['packages'].each do |base_package|
package base_package
end
route53_record "create_A_record" do
name node.name
value node['ipaddress']
type "A"
weight "1"
zone_id node['base']['aws']['route53']['zone_id'][node['ec2']['region']]
overwrite true
action :create
ttl node['base']['route53']['ttl']
end
unit test
require 'ChefSpec'
require 'spec_helper'
describe 'base::default' do
before(:all) do
end
context 'When all attributes are default, on an amazon 2017.09' do
let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'amazon', version: '2017.09',step_into: ['aws_route53_record']) do |node|
node.automatic['ec2']['region'] = 'us-east-1'
end.converge(described_recipe)
end
it 'converges successfully' do
expect{ chef_run }.to_not raise_error
end
it "install packages" do
chef_run.node['base']['packages'].each do |pkg|
expect(chef_run).to install_package(pkg)
end
end
it "create route53 record" do
expect(chef_run).to create_aws_route53_record('create_A_record')
end
end
end
output
..F
Failures:
1) base::default When all attributes are default, on an amazon 2017.09 create route53 record
Failure/Error: expect(chef_run).to create_aws_route53_record('create_A_record')
expected "aws_route53_record[create_A_record]" with action :create to be in Chef run. Other aws_route53_record resources:
# ./cookbooks/base/spec/unit/recipes/default_spec.rb:32:in `block (3 levels) in <top (required)>'
Finished in 16.72 seconds (files took 2.33 seconds to load)
3 examples, 1 failure
Failed examples:
rspec ./cookbooks/base/spec/unit/recipes/default_spec.rb:30 # base::default When all attributes are default, on an amazon 2017.09 create route53 record
ChefSpec Coverage report generated...
Total Resources: 23
Touched Resources: 2
Touch Coverage: 8.7%
Untouched Resources:
file[/etc/hostname] hostname/recipes/default.rb:103
....
aws_route53_record[chefspec] base/recipes/default.rb:15
as mention above its showing resource name as aws_route53_record[chefspec] which should be aws_route53_record[create_A_record] according to recipe.
i have tried above test cases with step_in and without it as well but same error
i have tried with resource as route53_record as mention in my recipe(its same provider but just multiple provides for old cookbook support ) but getting below error
Failures:
1) base::default When all attributes are default, on an amazon 2017.09 create route53 record
Failure/Error: expect(chef_run).to create_route53_record('create_A_record')
expected "route53_record[create_A_record]" with action :create to be in Chef run. Other route53_record resources:
aws_route53_record[chefspec]
# ./cookbooks/base/spec/unit/recipes/default_spec.rb:32:in `block (3 levels) in <top (required)>'
Finished in 15.82 seconds (files took 2.33 seconds to load)
3 examples, 1 failure
The text was updated successfully, but these errors were encountered:
recipe
unit test
output
as mention above its showing resource name as aws_route53_record[chefspec] which should be aws_route53_record[create_A_record] according to recipe.
i have tried above test cases with step_in and without it as well but same error
I am using standard aws cookbook for aws_route53_record resource
https://github.com/chef-cookbooks/aws
i have tried with resource as route53_record as mention in my recipe(its same provider but just multiple provides for old cookbook support ) but getting below error
The text was updated successfully, but these errors were encountered: