Last active
August 29, 2015 14:14
-
-
Save ikuwow/3c39ec8048e99c502b00 to your computer and use it in GitHub Desktop.
serverspecのpackageリソースはrpmコマンドでテストをする ref: http://qiita.com/ikuwow/items/27b99b6540ee48afa988
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ tree spec/ | |
| spec/ | |
| ├── default | |
| │ └── sample_spec.rb | |
| └── spec_helper.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Failures: | |
| 1) Package "vim" should be installed | |
| On host `default' | |
| Failure/Error: it { should be_installed } | |
| expected Package "vim" to be installed | |
| sudo -p 'Password: ' /bin/sh -c rpm\ -q\ vim | |
| package vim is not installed | |
| # ./spec/default/sample_spec.rb:4:in `block (2 levels) in <top (required)>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rpm -qa | grep vim | |
| vim-common-7.2.411-1.8.el6.x86_64 | |
| vim-enhanced-7.2.411-1.8.el6.x86_64 | |
| vim-minimal-7.2.411-1.8.el6.x86_64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Package "vim-common" | |
| should be installed | |
| Package "vim-enhanced" | |
| should be installed | |
| Package "vim-minimal" | |
| should be installed | |
| Finished in 0.69752 seconds (files took 6.01 seconds to load) | |
| 3 examples, 0 failures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| %w{vim-common vim-enhanced vim-minimal}.each do |vim| | |
| describe package(vim) do | |
| it { should be_installed } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment