jimdo-rspec-puppet-helpers 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +14 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/jimdo-rspec-puppet-helpers.gemspec +15 -0
- data/lib/jimdo-rspec-puppet-helpers.rb +50 -0
- metadata +55 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Daniel Bonkowski
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# jimdo-rspec-puppet-helpers
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jimdo-rspec-puppet-helpers'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jimdo-rspec-puppet-helpers
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
Gem::Specification.new do |gem|
|
3
|
+
gem.authors = ["Daniel Bonkowski", "Ingo Oeser", "Soenke Ruempler"]
|
4
|
+
gem.email = ["infrateam@jimdo.com" ]
|
5
|
+
gem.description = %q{rspec-puppet helpers}
|
6
|
+
gem.summary = %q{rspec-puppet helpers}
|
7
|
+
gem.homepage = ""
|
8
|
+
|
9
|
+
gem.files = `git ls-files`.split($\)
|
10
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
11
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
12
|
+
gem.name = "jimdo-rspec-puppet-helpers"
|
13
|
+
gem.require_paths = ["lib"]
|
14
|
+
gem.version = '0.0.3'
|
15
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
RSpec::Matchers.define :puppet_file_contains do |file, expected|
|
4
|
+
match do |actual|
|
5
|
+
files = actual.resource('file', file).to_hash[:source].map do |catalog_file|
|
6
|
+
catalog_file.gsub(/^puppet:\/\//, '')
|
7
|
+
end
|
8
|
+
found_file = nil
|
9
|
+
files.each do |catalog_file|
|
10
|
+
sliced_path = catalog_file.split('/')
|
11
|
+
module_path = sliced_path[1..2]
|
12
|
+
relative_path_in_puppet_files = sliced_path.slice(3..sliced_path.length)
|
13
|
+
|
14
|
+
# check whether we have rspec fixtures
|
15
|
+
if File.directory?("./spec/fixtures") then
|
16
|
+
path = File.expand_path(
|
17
|
+
File.join(
|
18
|
+
'spec/fixtures',
|
19
|
+
module_path,
|
20
|
+
'files',
|
21
|
+
relative_path_in_puppet_files
|
22
|
+
)
|
23
|
+
);
|
24
|
+
# else use files in puppet source tree
|
25
|
+
else
|
26
|
+
path = File.expand_path(
|
27
|
+
File.join(
|
28
|
+
module_path,
|
29
|
+
'files',
|
30
|
+
relative_path_in_puppet_files
|
31
|
+
)
|
32
|
+
);
|
33
|
+
end
|
34
|
+
if File.file?(path) then
|
35
|
+
found_file = path
|
36
|
+
break
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
if !found_file then
|
41
|
+
false
|
42
|
+
else
|
43
|
+
expected.match(IO.read(found_file)) != nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
failure_message_for_should do |actual|
|
48
|
+
"expected that it matches #{expected}"
|
49
|
+
end
|
50
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jimdo-rspec-puppet-helpers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Daniel Bonkowski
|
9
|
+
- Ingo Oeser
|
10
|
+
- Soenke Ruempler
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2013-05-29 00:00:00.000000000 Z
|
15
|
+
dependencies: []
|
16
|
+
description: rspec-puppet helpers
|
17
|
+
email:
|
18
|
+
- infrateam@jimdo.com
|
19
|
+
executables: []
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- Gemfile
|
25
|
+
- Gemfile.lock
|
26
|
+
- LICENSE
|
27
|
+
- README.md
|
28
|
+
- Rakefile
|
29
|
+
- jimdo-rspec-puppet-helpers.gemspec
|
30
|
+
- lib/jimdo-rspec-puppet-helpers.rb
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.25
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: rspec-puppet helpers
|
55
|
+
test_files: []
|