puppet-retrospec 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -6
- data/LICENSE +661 -20
- data/README.md +93 -45
- data/VERSION +1 -1
- data/bin/retrospec +6 -2
- data/lib/{puppet-retrospec.rb → retrospec.rb} +13 -50
- data/lib/retrospec/conditional.rb +53 -0
- data/lib/{helpers.rb → retrospec/helpers.rb} +4 -0
- data/lib/retrospec/resource.rb +37 -0
- data/lib/{templates → retrospec/templates}/acceptance_spec_test.erb +0 -0
- data/lib/{templates → retrospec/templates}/fixtures_file.erb +1 -1
- data/lib/{templates → retrospec/templates}/gemfile.erb +1 -1
- data/lib/{templates → retrospec/templates}/nodesets/centos-59-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/centos-64-x64-pe.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/centos-64-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/centos-65-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/debian-607-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/debian-70rc1-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/debian-73-i386.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/debian-73-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/default.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/fedora-18-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/sles-11sp1-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-10044-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-12042-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-1310-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-1404-x64.yml +0 -0
- data/lib/{templates → retrospec/templates}/rakefile.erb +0 -0
- data/lib/retrospec/templates/resource_spec_file.erb +45 -0
- data/lib/{templates → retrospec/templates}/shared_context.erb +3 -1
- data/lib/{templates → retrospec/templates}/spec_helper_acceptance.rb.erb +0 -0
- data/lib/{templates → retrospec/templates}/spec_helper_file.erb +0 -0
- data/lib/retrospec/type_code.rb +18 -0
- data/lib/retrospec/variable_store.rb +82 -0
- data/lib/retrospec/version.rb +3 -0
- data/puppet-retrospec.gemspec +54 -33
- data/spec/fixtures/fixture_modules/one_resource_module/manifests/another_resource_class.pp +28 -0
- data/spec/fixtures/fixture_modules/one_resource_module/manifests/one_resource_class.pp +6 -0
- data/spec/fixtures/fixture_modules/zero_resource_module/manifests/empty_class.pp +3 -0
- data/spec/spec_helper.rb +2 -1
- data/spec/unit/conditional_spec.rb +43 -0
- data/spec/unit/puppet-retrospec_spec.rb +4 -41
- data/spec/unit/resource_spec.rb +62 -0
- data/spec/unit/type_code_spec.rb +39 -0
- data/spec/unit/variable_store_spec.rb +82 -0
- metadata +107 -53
- data/lib/templates/resource_spec_file.erb +0 -40
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'shared_contexts'
|
3
|
-
|
4
|
-
describe '<%= @type.name -%>' do
|
5
|
-
# by default the hiera integration uses hirea data from the shared_contexts.rb file
|
6
|
-
# but basically to mock hiera you first need to add a key/value pair
|
7
|
-
# to the specific context in the spec/shared_contexts.rb file
|
8
|
-
# Note: you can only use a single hiera context per describe/context block
|
9
|
-
# rspec-puppet does not allow you to swap out hiera data on a per test block
|
10
|
-
include_context :hiera
|
11
|
-
|
12
|
-
<%- if @type.type == :definition -%>
|
13
|
-
let(:title) { 'example_name' }
|
14
|
-
<%- end -%>
|
15
|
-
|
16
|
-
# below is the facts hash that gives you the ability to mock
|
17
|
-
# facts on a per describe/context block. If you use a fact in your
|
18
|
-
# manifest you should mock the facts below.
|
19
|
-
let(:facts) do
|
20
|
-
{}
|
21
|
-
end
|
22
|
-
# below is a list of the resource parameters that you can override
|
23
|
-
# by default all non-required parameters are commented out
|
24
|
-
# while all required parameters will require you to add a value
|
25
|
-
let(:params) do
|
26
|
-
{
|
27
|
-
<%- @parameters.each do |k,v| -%>
|
28
|
-
<%- if v.nil? -%>
|
29
|
-
<%= ":#{k} => 'place_value_here'," %>
|
30
|
-
<%- else -%>
|
31
|
-
<%= "#:#{k} => #{v}," %>
|
32
|
-
<%- end -%>
|
33
|
-
<%- end -%>
|
34
|
-
}
|
35
|
-
end
|
36
|
-
# add these two lines in a single test block to enable puppet and hiera debug mode
|
37
|
-
# Puppet::Util::Log.level = :debug
|
38
|
-
# Puppet::Util::Log.newdestination(:console)
|
39
|
-
it { should compile }
|
40
|
-
end
|