rspec-puppet-yaml 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -1
- data/lib/rspec-puppet-yaml/extenders.rb +2 -2
- data/lib/rspec-puppet-yaml/version.rb +1 -1
- data/lib/rspec-puppet/matcher_helpers.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f4eac7456f0316b8cd14f261d667a415d00537
|
4
|
+
data.tar.gz: 2be6d8e4ab1cd5737d3d1c5d71aa6549b739d258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c6b0ffa09d8bb7cfc32bfe1744e55ecc979f9ff8febacea9533b6d84f304e5b80b266a4063a7713055178fb609127bb0a2a98599f2594e0bfb2b619b61de492
|
7
|
+
data.tar.gz: 42bf3800dd7ddbb1c5d6e3a49adeb2b5a54eb35006d06c4c198c607f6d018979771b740f8b3e865da9dee6490cd427ad8b5ee090474f5c5ccb9547eb7e0043d4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# rspec-puppet-yaml
|
2
2
|
|
3
|
-
[](https://travis-ci.org/wwkimball/rspec-puppet-yaml)
|
3
|
+
[](https://travis-ci.org/wwkimball/rspec-puppet-yaml)
|
4
|
+
[](https://inch-ci.org/github/wwkimball/rspec-puppet-yaml)
|
4
5
|
|
5
6
|
This gem enables Puppet module authors to write RSpec unit tests as YAML instead
|
6
7
|
of Ruby (omitting the single, trivial line of code necessary to pass your YAML
|
@@ -315,6 +316,14 @@ describe "my_module" {
|
|
315
316
|
it { is_expected.to contain_service('keystone_2').without(
|
316
317
|
['restart', 'status']
|
317
318
|
)}
|
319
|
+
|
320
|
+
it { is_expected.to contain_file('/path/file').with_content(/foobar/) }
|
321
|
+
|
322
|
+
it do
|
323
|
+
is_expected.to contain_file('/other/path/file')
|
324
|
+
.with_content(/foobar/)
|
325
|
+
.with_content(/bazbar/)
|
326
|
+
end
|
318
327
|
}
|
319
328
|
```
|
320
329
|
|
@@ -354,6 +363,12 @@ describe:
|
|
354
363
|
contain_file:
|
355
364
|
/foo/bar:
|
356
365
|
- without_mode
|
366
|
+
/path/file:
|
367
|
+
with_content: !ruby/regexp /foobar/
|
368
|
+
/other/path/file:
|
369
|
+
with_content:
|
370
|
+
- !ruby/regexp /foobar/
|
371
|
+
- !ruby/regexp /bazbar/
|
357
372
|
```
|
358
373
|
|
359
374
|
##### With stipulated resource relationships
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Identifies a YAML data file based on the name of a *_spec.rb rspec file and
|
2
2
|
# passes it to `parse_rspec_puppet_yaml` to initiate parsing.
|
3
3
|
#
|
4
|
-
# @param rspec_file Path to and name of the RSpec *_spec.rb file. It
|
5
|
-
# to simply pass `__FILE__` to this function from that file.
|
4
|
+
# @param rspec_file [String] Path to and name of the RSpec *_spec.rb file. It
|
5
|
+
# is easiest to simply pass `__FILE__` to this function from that file.
|
6
6
|
#
|
7
7
|
# @example Typical use
|
8
8
|
# require 'spec_helper'
|
@@ -120,7 +120,13 @@ module RSpec::Puppet
|
|
120
120
|
if v.nil? || 'nil' == v.to_s
|
121
121
|
matcher.send(k.to_sym)
|
122
122
|
else
|
123
|
-
|
123
|
+
# Enable content tests to specify arrays so that multiple discrete
|
124
|
+
# contents can be searched.
|
125
|
+
if k =~ /(with_|without_)?content/ && v.kind_of?(Array)
|
126
|
+
v.each{ |l| matcher.send(k.to_sym, l) }
|
127
|
+
else
|
128
|
+
matcher.send(k.to_sym, v)
|
129
|
+
end
|
124
130
|
end
|
125
131
|
end
|
126
132
|
elsif !tests.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-puppet-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William W. Kimball, Jr., MBA, MSIS
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|