From 7adaabe46b9f28b63ccfe93269c3fec6ccffe071 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Sat, 14 Jun 2014 00:29:51 -0700 Subject: [PATCH] Added basic rspec files. --- .rspec | 2 ++ Gemfile | 2 ++ attributes/default.rb | 2 +- recipes/default.rb | 4 +++- spec/.rubocop.yml | 4 ++++ spec/default_spec.rb | 9 +++++++++ spec/spec_helper.rb | 3 +++ 7 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .rspec create mode 100644 spec/.rubocop.yml create mode 100644 spec/default_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..8c18f1a --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--format documentation +--color diff --git a/Gemfile b/Gemfile index cbc08e4..ca5d4b9 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,8 @@ gem 'chef', '~> 11.12.4' gem 'berkshelf', '~> 3.1.2' group :development do + gem 'chef-zero', '~> 2.1.5' + gem 'yard', '~> 0.8.7.4' gem 'yard-chef', '~> 1.0.0' gem 'github-markup', '1.2.1' diff --git a/attributes/default.rb b/attributes/default.rb index c8438b4..40410b4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,5 +1,5 @@ # -# Cookbook Name:: replace_name +# Cookbook Name:: replace_cookbook_name # Attributes:: default # # Copyright replace_yyyy replace_name_of_copyright_owner diff --git a/recipes/default.rb b/recipes/default.rb index 022d714..956311e 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,5 +1,5 @@ # -# Cookbook Name:: replace_name +# Cookbook Name:: replace_cookbook_name # Recipe:: default # # Copyright replace_yyyy replace_name_of_copyright_owner @@ -16,3 +16,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +log 'replace_this' diff --git a/spec/.rubocop.yml b/spec/.rubocop.yml new file mode 100644 index 0000000..7db3443 --- /dev/null +++ b/spec/.rubocop.yml @@ -0,0 +1,4 @@ +inherit_from: ../.rubocop.yml + +Style/StringLiterals: + Enabled: false diff --git a/spec/default_spec.rb b/spec/default_spec.rb new file mode 100644 index 0000000..6f5936d --- /dev/null +++ b/spec/default_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe 'replace_cookbook_name::default' do + let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) } + + it "replace_does_something" do + expect(chef_run).to write_log 'replace_this' + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..ac7748f --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,3 @@ +require 'chefspec' +require 'chefspec/berkshelf' +require 'chefspec/server'