rspec-puppet-yaml 0.1.0 → 0.1.1

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: 635d74aae6ca5cabe2a88ca0d09e1c6f0c6cc099
4
- data.tar.gz: 379c30071212890a4b04238c11fc87a41b4372c7
3
+ metadata.gz: 72f4eac7456f0316b8cd14f261d667a415d00537
4
+ data.tar.gz: 2be6d8e4ab1cd5737d3d1c5d71aa6549b739d258
5
5
  SHA512:
6
- metadata.gz: 446246c48b97c01201621d793abef3b3e1bfde738da4016003dc6dec2c1ce003de34021d9f5e47c4c3757b8e80772abe14bc1f1075844fda5c5dfdadbf2d92ae
7
- data.tar.gz: 8a5c2d3ac8c5d7a43f4cea2abf8746d29365cba4ce4a76aadf3788c0cd723c2e5a7af9267f227891488c88ac810bc603e2e10a341e83a72a642e2094cedb052f
6
+ metadata.gz: 4c6b0ffa09d8bb7cfc32bfe1744e55ecc979f9ff8febacea9533b6d84f304e5b80b266a4063a7713055178fb609127bb0a2a98599f2594e0bfb2b619b61de492
7
+ data.tar.gz: 42bf3800dd7ddbb1c5d6e3a49adeb2b5a54eb35006d06c4c198c607f6d018979771b740f8b3e865da9dee6490cd427ad8b5ee090474f5c5ccb9547eb7e0043d4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-puppet-yaml (0.1.0)
4
+ rspec-puppet-yaml (0.1.1)
5
5
  deep_merge (~> 1.1)
6
6
  rspec-puppet (~> 2.6)
7
7
 
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # rspec-puppet-yaml
2
2
 
3
- [![Build Status](https://travis-ci.org/wwkimball/rspec-puppet-yaml.svg?branch=master)](https://travis-ci.org/wwkimball/rspec-puppet-yaml) [![Documentation Coverage](https://inch-ci.org/github/wwkimball/rspec-puppet-yaml.svg?branch=master)](https://inch-ci.org/github/wwkimball/rspec-puppet-yaml)
3
+ [![Build Status](https://travis-ci.org/wwkimball/rspec-puppet-yaml.svg?branch=master)](https://travis-ci.org/wwkimball/rspec-puppet-yaml)
4
+ [![Documentation Coverage](https://inch-ci.org/github/wwkimball/rspec-puppet-yaml.svg?branch=master)](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 is easiest
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'
@@ -5,7 +5,7 @@ module RSpec
5
5
  # Ruby.
6
6
  module Yaml
7
7
  # Version number for the rspec-puppet-yaml Ruby gem
8
- VERSION = "0.1.0"
8
+ VERSION = "0.1.1"
9
9
  end
10
10
  end
11
11
  end
@@ -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
- matcher.send(k.to_sym, v)
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2017-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler