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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -6
  3. data/LICENSE +661 -20
  4. data/README.md +93 -45
  5. data/VERSION +1 -1
  6. data/bin/retrospec +6 -2
  7. data/lib/{puppet-retrospec.rb → retrospec.rb} +13 -50
  8. data/lib/retrospec/conditional.rb +53 -0
  9. data/lib/{helpers.rb → retrospec/helpers.rb} +4 -0
  10. data/lib/retrospec/resource.rb +37 -0
  11. data/lib/{templates → retrospec/templates}/acceptance_spec_test.erb +0 -0
  12. data/lib/{templates → retrospec/templates}/fixtures_file.erb +1 -1
  13. data/lib/{templates → retrospec/templates}/gemfile.erb +1 -1
  14. data/lib/{templates → retrospec/templates}/nodesets/centos-59-x64.yml +0 -0
  15. data/lib/{templates → retrospec/templates}/nodesets/centos-64-x64-pe.yml +0 -0
  16. data/lib/{templates → retrospec/templates}/nodesets/centos-64-x64.yml +0 -0
  17. data/lib/{templates → retrospec/templates}/nodesets/centos-65-x64.yml +0 -0
  18. data/lib/{templates → retrospec/templates}/nodesets/debian-607-x64.yml +0 -0
  19. data/lib/{templates → retrospec/templates}/nodesets/debian-70rc1-x64.yml +0 -0
  20. data/lib/{templates → retrospec/templates}/nodesets/debian-73-i386.yml +0 -0
  21. data/lib/{templates → retrospec/templates}/nodesets/debian-73-x64.yml +0 -0
  22. data/lib/{templates → retrospec/templates}/nodesets/default.yml +0 -0
  23. data/lib/{templates → retrospec/templates}/nodesets/fedora-18-x64.yml +0 -0
  24. data/lib/{templates → retrospec/templates}/nodesets/sles-11sp1-x64.yml +0 -0
  25. data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-10044-x64.yml +0 -0
  26. data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-12042-x64.yml +0 -0
  27. data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-1310-x64.yml +0 -0
  28. data/lib/{templates → retrospec/templates}/nodesets/ubuntu-server-1404-x64.yml +0 -0
  29. data/lib/{templates → retrospec/templates}/rakefile.erb +0 -0
  30. data/lib/retrospec/templates/resource_spec_file.erb +45 -0
  31. data/lib/{templates → retrospec/templates}/shared_context.erb +3 -1
  32. data/lib/{templates → retrospec/templates}/spec_helper_acceptance.rb.erb +0 -0
  33. data/lib/{templates → retrospec/templates}/spec_helper_file.erb +0 -0
  34. data/lib/retrospec/type_code.rb +18 -0
  35. data/lib/retrospec/variable_store.rb +82 -0
  36. data/lib/retrospec/version.rb +3 -0
  37. data/puppet-retrospec.gemspec +54 -33
  38. data/spec/fixtures/fixture_modules/one_resource_module/manifests/another_resource_class.pp +28 -0
  39. data/spec/fixtures/fixture_modules/one_resource_module/manifests/one_resource_class.pp +6 -0
  40. data/spec/fixtures/fixture_modules/zero_resource_module/manifests/empty_class.pp +3 -0
  41. data/spec/spec_helper.rb +2 -1
  42. data/spec/unit/conditional_spec.rb +43 -0
  43. data/spec/unit/puppet-retrospec_spec.rb +4 -41
  44. data/spec/unit/resource_spec.rb +62 -0
  45. data/spec/unit/type_code_spec.rb +39 -0
  46. data/spec/unit/variable_store_spec.rb +82 -0
  47. metadata +107 -53
  48. 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