rspec-puppet-augeas 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f06061bfcf98a5fcbc5c74c34f24bbf6c6d0351
4
- data.tar.gz: 4e3dbe939a0d3df172a1a830cb389e60e30af92e
3
+ metadata.gz: 0eae805ca8db763bdea0f2e2aa67ad0c91305821
4
+ data.tar.gz: acd92835edbe08de485c26f05cc2ddbb6c66d48f
5
5
  SHA512:
6
- metadata.gz: 18c6661cab9a5458a711935a9245566c4441a1c73d2de328bc130a911f91f43aaaa9a481970389f92d0b309f31bcb41833a6e2f7d08b82612e882a4aa291fa2a
7
- data.tar.gz: efd749b3d0333d63770aa8b0f09aa5bc2477ff59da6db9923d1f5f6628a226f08b3cb8b5767d961506b03e4ef0b167c594943d9eee9fab749c0688ba062a5ee0
6
+ metadata.gz: d77966c98c9cf464945697ae5f25b51ef4a5fb61f5d90b322b0243532d941cf76600cf52bdde89b5ce38a80e8862a09a53b8664dc619f98fbe7e3cae643fc301
7
+ data.tar.gz: e372a0ec2945b5b783d5bee7e822ad4bfb84f744565f02aa0186b750702b7a984ed6fdacc605323ac2c05a861048212fa2c389d0a7a68e3b04de57ea66c99a19
data/Gemfile CHANGED
@@ -1,13 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'puppetlabs_spec_helper'
4
- gem 'rspec-puppet', '< 1.0.0'
5
- gem 'ruby-augeas'
3
+ gemspec
6
4
 
7
5
  group :test do
8
6
  gem 'puppet'
9
7
  gem 'rake'
10
8
  gem 'simplecov'
9
+ gem 'rspec', '< 3.2' if RUBY_VERSION < '1.9'
11
10
  end
12
11
 
13
12
  self.instance_eval(Bundler.read_file('Gemfile.local')) if File.exist? 'Gemfile.local'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Dominic Cleal
1
+ Copyright (c) 2013-2015 Dominic Cleal
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -14,7 +14,8 @@ Install the gem first:
14
14
 
15
15
  gem install rspec-puppet-augeas
16
16
 
17
- **Note:** The `ruby-augeas` gem and the augeas tools and development libraries are also required.
17
+ **Note:** The augeas tools and development libraries are also required to
18
+ install the ruby-augeas dependency.
18
19
 
19
20
  Extend your usual rspec-puppet class test, e.g. for the 'sshd' class:
20
21
 
@@ -162,12 +163,11 @@ before_install:
162
163
 
163
164
  ### Changes to `Gemfile`
164
165
 
165
- The `rspec-puppet-augeas` and `ruby-augeas` gems need to be added into the development and test group:
166
+ The `rspec-puppet-augeas` gem needs to be added into the development and test group:
166
167
 
167
168
  ```ruby
168
169
  group :development, :test do
169
170
  gem 'puppetlabs_spec_helper', :require => false
170
- gem 'ruby-augeas', :require => false
171
171
  gem 'rspec-puppet-augeas', :require => false
172
172
  end
173
173
  ```
@@ -40,6 +40,10 @@ module RSpec::Puppet::Augeas
40
40
  Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(logs))
41
41
  Puppet::Util::Log.level = 'debug'
42
42
 
43
+ confdir = Dir.mktmpdir
44
+ oldconfdir = Puppet[:confdir]
45
+ Puppet[:confdir] = confdir
46
+
43
47
  [:require, :before, :notify, :subscribe].each { |p| resource.delete p }
44
48
  catalog = Puppet::Resource::Catalog.new
45
49
  catalog.add_resource resource
@@ -48,6 +52,11 @@ module RSpec::Puppet::Augeas
48
52
 
49
53
  Puppet::Util::Log.close_all
50
54
  txn
55
+ ensure
56
+ if confdir
57
+ Puppet[:confdir] = oldconfdir
58
+ FileUtils.rm_rf(confdir)
59
+ end
51
60
  end
52
61
  end
53
62
  end
@@ -13,6 +13,7 @@ module RSpec::Puppet::Augeas::Matchers
13
13
 
14
14
  def matches?(resource)
15
15
  @resource = resource
16
+ RSpec::Puppet::Coverage.cover!(resource)
16
17
  return false if resource.txn.any_failed?
17
18
  return false if change and !resource.txn.changed?.any?
18
19
  return false if idempotent and resource.idempotent.changed?.any?
@@ -1,9 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rspec-puppet-augeas'
3
- s.version = '0.3.0'
3
+ s.version = '0.4.0'
4
4
  s.homepage = 'https://github.com/domcleal/rspec-puppet-augeas/'
5
5
  s.summary = 'RSpec tests for Augeas resources in Puppet manifests'
6
6
  s.description = 'RSpec tests for Augeas resources in Puppet manifests'
7
+ s.license = 'MIT'
7
8
 
8
9
  s.files = [
9
10
  '.gitignore',
@@ -28,8 +29,9 @@ Gem::Specification.new do |s|
28
29
  'spec/spec_helper.rb'
29
30
  ]
30
31
 
31
- s.add_dependency 'rspec-puppet', '< 1.0.0'
32
+ s.add_dependency 'rspec-puppet', '>= 2.0.0'
32
33
  s.add_dependency 'puppetlabs_spec_helper'
34
+ s.add_dependency 'ruby-augeas'
33
35
 
34
36
  s.authors = ['Dominic Cleal']
35
37
  s.email = 'dcleal@redhat.com'
@@ -112,12 +112,12 @@ describe 'sshd' do
112
112
  e = execute
113
113
  e.matches? subject
114
114
  e.description.should =~ /execute/
115
- e.failure_message_for_should.should =~ /^err:.*false/
116
- e.failure_message_for_should_not.should =~ /^err:.*false/
115
+ e.failure_message_for_should.should =~ /^err:.*(false|failed)/
116
+ e.failure_message_for_should_not.should =~ /^err:.*(false|failed)/
117
117
  # Check for debug logs
118
118
  e.failure_message_for_should.should =~ /^debug:.*Opening augeas/
119
119
  # Ignore transaction stuff
120
- e.failure_message_for_should.split("\n").grep(/Finishing transaction/).empty?.should be_true
120
+ e.failure_message_for_should.split("\n").grep(/Finishing transaction/).empty?.should eq(true)
121
121
  end
122
122
  end
123
123
 
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet-augeas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-29 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-puppet
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - <
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 2.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - <
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: puppetlabs_spec_helper
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby-augeas
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: RSpec tests for Augeas resources in Puppet manifests
42
56
  email: dcleal@redhat.com
43
57
  executables: []
@@ -65,7 +79,8 @@ files:
65
79
  - spec/fixtures/modules/sshd/manifests/init.pp
66
80
  - spec/spec_helper.rb
67
81
  homepage: https://github.com/domcleal/rspec-puppet-augeas/
68
- licenses: []
82
+ licenses:
83
+ - MIT
69
84
  metadata: {}
70
85
  post_install_message:
71
86
  rdoc_options: []