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 +4 -4
- data/lib/serverspec/matcher/contain.rb +6 -2
- data/lib/serverspec/version.rb +1 -1
- data/spec/type/base/command_spec.rb +5 -0
- 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: 7ec3be10279eb102c596746869b1d1d55709c732
|
4
|
+
data.tar.gz: 325dd53f2dd1f87c39c092425ce26886a5cd379c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee7c4b404b30816d84cec6e3c76ee7f9f2c8655e09955d62ba5f28859d7467405b802643fe6069f03246725d1d7ecdec1b20264b78fd26c24a720abc0788d93
|
7
|
+
data.tar.gz: 72bae1f47fcee1cf140074db7ba2b5988543d1f54ab521de402a0c2397320e173747b10bfbcb54ee51c19e5b853e20c33f8083c2e14ad916cb61d1b8d12f04e6
|
@@ -1,6 +1,10 @@
|
|
1
1
|
RSpec::Matchers.define :contain do |pattern|
|
2
|
-
match do |
|
3
|
-
|
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/)
|
data/lib/serverspec/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|