serverspec 2.13.0 → 2.14.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: 7e52d49733ff4dec34b0fbdced1a45884d315b27
4
- data.tar.gz: 4fe90f21f904f8e51b09d3f0c878cc22db11d224
3
+ metadata.gz: 7ec3be10279eb102c596746869b1d1d55709c732
4
+ data.tar.gz: 325dd53f2dd1f87c39c092425ce26886a5cd379c
5
5
  SHA512:
6
- metadata.gz: fbe196f725152c1c4133e411fd1201d3881412c3c99d8c1b6ff7bc6616761e5f1f339357d5dd35f0621cc643453b8e3fa4b55c27ab220b25d8bfa8ced85f09c2
7
- data.tar.gz: 6b9962d40d1ab0d7877f0f9e3962afce2f228f7918d7b79211cbe104835a28172d0798573e282c3c1dcf727c394afc0695089cccd99742849b7cfd8cd3a68dec
6
+ metadata.gz: fee7c4b404b30816d84cec6e3c76ee7f9f2c8655e09955d62ba5f28859d7467405b802643fe6069f03246725d1d7ecdec1b20264b78fd26c24a720abc0788d93
7
+ data.tar.gz: 72bae1f47fcee1cf140074db7ba2b5988543d1f54ab521de402a0c2397320e173747b10bfbcb54ee51c19e5b853e20c33f8083c2e14ad916cb61d1b8d12f04e6
@@ -1,6 +1,10 @@
1
1
  RSpec::Matchers.define :contain do |pattern|
2
- match do |file|
3
- file.contain(pattern, @from, @to)
2
+ match do |resource|
3
+ if resource.is_a?(String)
4
+ resource.match(Regexp.new([@from, pattern, @to].compact.join.gsub('/', '.*'), Regexp::MULTILINE))
5
+ else
6
+ resource.contain(pattern, @from, @to)
7
+ end
4
8
  end
5
9
 
6
10
  # for contain(pattern).from(/A/).to(/B/)
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.13.0"
2
+ VERSION = "2.14.0"
3
3
  end
@@ -59,4 +59,9 @@ EOF
59
59
 
60
60
  its(:stdout) { should match /bin/ }
61
61
  its(:stdout) { should eq stdout }
62
+ its(:stdout) { should contain('4260') }
63
+ its(:stdout) { should contain('4260').from('bin').to('home') }
64
+ its(:stdout) { should contain('4260').after('bin') }
65
+ its(:stdout) { should contain('4260').before('home') }
66
+ its(:stdout) { should_not contain('4260').before('bin') }
62
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec