Created
November 2, 2012 22:26
-
-
Save retr0h/4004735 to your computer and use it in GitHub Desktop.
This file contains 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
execute "create swapfile" do | |
command <<-eof | |
dd if=/dev/zero of=#{swap_location} bs=1M count=#{swap_size_megs} && | |
chmod 600 #{swap_location} && | |
mkswap #{swap_location} | |
eof | |
not_if { File.exists?("#{swap_location}") } | |
end | |
describe "create space" do | |
it "turns the file into swap" do | |
@chef_run.should execute_command "mkswap /var/swapfile" | |
end | |
end | |
### | |
Failures: | |
1) swap::default create space turns the file into swap | |
Failure/Error: @chef_run.should execute_command "mkswap /var/swapfile" | |
expected chef_run: recipe[swap::default] to execute command "mkswap /var/swapfile" | |
# ./cookbooks/swap/spec/swap_spec.rb:18:in `block (3 levels) in <top (required)>' | |
Finished in 0.00396 seconds | |
1 example, 1 failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could do something like: