This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from charlesjohnson/add-chefspec-to-generators
Add chefspec to generators
- Loading branch information
Showing
15 changed files
with
129 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
lib/chef-dk/skeletons/code_generator/files/default/converge_spec.rb
This file was deleted.
Oops, something went wrong.
8 changes: 1 addition & 7 deletions
8
lib/chef-dk/skeletons/code_generator/files/default/spec_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
require 'chefspec' | ||
|
||
current_dir = File.dirname(__FILE__) | ||
|
||
RSpec.configure do |config| | ||
# Point to the cookbooks directory | ||
config.cookbook_path = File.join(current_dir, '../cookbooks') | ||
end | ||
require 'chefspec/berkshelf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
lib/chef-dk/skeletons/code_generator/templates/default/default_recipe.rb.erb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Cookbook Name:: <%= cookbook_name %> | ||
# Recipe:: <%= recipe_name %> | ||
# | ||
<%= license_description('#') %> |
23 changes: 23 additions & 0 deletions
23
lib/chef-dk/skeletons/code_generator/templates/default/recipe_spec.rb.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Cookbook Name:: <%= cookbook_name %> | ||
# Spec:: default | ||
# | ||
<%= license_description('#') %> | ||
|
||
require 'spec_helper' | ||
|
||
describe '<%= cookbook_name %>::<%= recipe_name %>' do | ||
|
||
context 'When all attributes are default, on an unspecified platform' do | ||
|
||
let(:chef_run) do | ||
runner = ChefSpec::ServerRunner.new | ||
runner.converge(described_recipe) | ||
end | ||
|
||
it 'converges successfully' do | ||
chef_run # This should not raise an error | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters