Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rpm on be_installed` matcher #203

Merged
merged 2 commits into from Jul 5, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/serverspec/commands/redhat.rb
Expand Up @@ -25,6 +25,8 @@ def check_installed(package,version=nil)
end
cmd
end

alias :check_installed_by_rpm :check_installed
end
end
end
9 changes: 9 additions & 0 deletions spec/redhat/package_spec.rb
Expand Up @@ -11,11 +11,20 @@
it { should_not be_installed }
end

package('invalid-package') do
it { should_not be_installed.by('rpm') }
end

describe package('httpd') do
it { should be_installed.with_version('2.2.15-28.el6') }
its(:command) { should eq "rpm -q httpd | grep -w -- 2.2.15-28.el6" }
end

describe package('httpd') do
it { should be_installed.by('rpm').with_version('2.2.15-28.el6') }
its(:command) { should eq "rpm -q httpd | grep -w -- 2.2.15-28.el6" }
end

describe package('httpd') do
it { should_not be_installed.with_version('invalid-version') }
end
Expand Down