serverspec 0.6.9 → 0.6.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,11 @@ module Serverspec
6
6
  end
7
7
 
8
8
  def check_installed(package, version=nil)
9
- "pkg list -H #{escape(package)} 2> /dev/null"
9
+ cmd = "pkg list -H #{escape(package)} 2> /dev/null"
10
+ if version
11
+ cmd = "#{cmd} | grep -qw -- #{escape(version)}"
12
+ end
13
+ cmd
10
14
  end
11
15
 
12
16
  def check_listening(port)
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.6.9"
2
+ VERSION = "0.6.10"
3
3
  end
@@ -57,6 +57,11 @@ describe 'check_installed' do
57
57
  it { should eq 'pkg list -H httpd 2> /dev/null' }
58
58
  end
59
59
 
60
+ describe 'check_installed' do
61
+ subject { commands.check_installed('httpd', '2.2') }
62
+ it { should eq 'pkg list -H httpd 2> /dev/null | grep -qw -- 2.2' }
63
+ end
64
+
60
65
  describe 'check_file_contain_within' do
61
66
  context 'contain a pattern in the file' do
62
67
  subject { commands.check_file_contain_within('Gemfile', 'rspec') }
@@ -4,6 +4,7 @@ include Serverspec::Helper::Solaris
4
4
 
5
5
  describe 'Serverspec package matchers of Solaris family' do
6
6
  it_behaves_like 'support package installed matcher', 'httpd'
7
+ it_behaves_like 'support package installed with version matcher', 'httpd', '2.2'
7
8
  it_behaves_like 'support package installed by gem matcher', 'jekyll'
8
9
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
9
10
  it_behaves_like 'support package installed by npm matcher', 'bower'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.6.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
12
+ date: 2013-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
324
324
  version: '0'
325
325
  requirements: []
326
326
  rubyforge_project:
327
- rubygems_version: 1.8.25
327
+ rubygems_version: 1.8.23
328
328
  signing_key:
329
329
  specification_version: 3
330
330
  summary: RSpec tests for your servers configured by Puppet, Chef or anything else