serverspec 0.7.11 → 0.7.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c971f7ffde09d489689464ca4c19537dc2732cfc
4
- data.tar.gz: 33def92c5874f2b856f300f4bf1575f02cf553cc
3
+ metadata.gz: a88006bcf12f56331752519df9b93cb4604d428a
4
+ data.tar.gz: eb22220b6e5551eaf1b58e8a3b9201beebc2620c
5
5
  SHA512:
6
- metadata.gz: dfaa2f7870f797adea5392280d35e6cb79e2faef78e3492f2152bf1a174c5c99c8d17827dc4581f8aa45ee07222dd78bcb0d5f8c4bf688df1e4e48b36fd54210
7
- data.tar.gz: 9eb049438d22bb921cdb570c79443b5d0f3791db92ee37908d2126b3507fcd186442070a987bedfd7987808a4cb3d2fbe653b2eb4d9192e4339fb9e8492f99c3
6
+ metadata.gz: 8ff71ed86d2b78ef5c14e3c29b22b41b162efdc95fe094e51c0a2dfa46c57ef94f7cfbf97983535e5c0f2e175e8b30eae8262eebd0ee17ca3d967bd3aaf04977
7
+ data.tar.gz: a78383740ac905a4481d3c57bcebc77e1ab59edbba71f15e2731f09632d89e0e504f4bbff27f8d16f24df180b42eedea8333d2d4147da6829a092c41ee18cab5
@@ -192,6 +192,13 @@ module Serverspec
192
192
  cmd
193
193
  end
194
194
 
195
+ def check_installed_by_pip(name, version=nil)
196
+ regexp = "^#{name}"
197
+ cmd = "pip list | grep -w -- #{escape(regexp)}"
198
+ cmd = "#{cmd} | grep -w -- #{escape(version)}" if version
199
+ cmd
200
+ end
201
+
195
202
  def check_belonging_group(user, group)
196
203
  "id #{escape(user)} | awk '{print $3}' | grep -- #{escape(group)}"
197
204
  end
@@ -11,6 +11,8 @@ module Serverspec
11
11
  type.capitalize!
12
12
  %Q!#{type} "#{@name}"!
13
13
  end
14
+
15
+ alias_method :inspect, :to_s
14
16
  end
15
17
  end
16
18
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.7.11"
2
+ VERSION = "0.7.12"
3
3
  end
@@ -56,3 +56,12 @@ end
56
56
  describe package('mongo') do
57
57
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
58
58
  end
59
+
60
+ describe package('supervisor') do
61
+ it { should be_installed.by('pip').with_version('3.0') }
62
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
63
+ end
64
+
65
+ describe package('invalid-pip') do
66
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
67
+ end
@@ -74,3 +74,12 @@ end
74
74
  describe package('mongo') do
75
75
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
76
76
  end
77
+
78
+ describe package('supervisor') do
79
+ it { should be_installed.by('pip').with_version('3.0') }
80
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
81
+ end
82
+
83
+ describe package('invalid-pip') do
84
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
85
+ end
@@ -65,3 +65,12 @@ end
65
65
  describe package('mongo') do
66
66
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
67
67
  end
68
+
69
+ describe package('supervisor') do
70
+ it { should be_installed.by('pip').with_version('3.0') }
71
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
72
+ end
73
+
74
+ describe package('invalid-pip') do
75
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
76
+ end
@@ -83,3 +83,12 @@ end
83
83
  describe package('mongo') do
84
84
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
85
85
  end
86
+
87
+ describe package('supervisor') do
88
+ it { should be_installed.by('pip').with_version('3.0') }
89
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
90
+ end
91
+
92
+ describe package('invalid-pip') do
93
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
94
+ end
@@ -74,3 +74,12 @@ end
74
74
  describe package('mongo') do
75
75
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
76
76
  end
77
+
78
+ describe package('supervisor') do
79
+ it { should be_installed.by('pip').with_version('3.0') }
80
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
81
+ end
82
+
83
+ describe package('invalid-pip') do
84
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
85
+ end
@@ -74,3 +74,12 @@ end
74
74
  describe package('mongo') do
75
75
  it { should_not be_installed.by('pecl').with_version('invalid-version') }
76
76
  end
77
+
78
+ describe package('supervisor') do
79
+ it { should be_installed.by('pip').with_version('3.0') }
80
+ its(:command) { should eq "pip list | grep -w -- \\^supervisor | grep -w -- 3.0" }
81
+ end
82
+
83
+ describe package('invalid-pip') do
84
+ it { should_not be_installed.by('pip').with_version('invalid-version') }
85
+ 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: 0.7.11
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-30 00:00:00.000000000 Z
11
+ date: 2013-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh