spec/sprinkle/verify_spec.rb in auser-sprinkle-0.1.5 vs spec/sprinkle/verify_spec.rb in auser-sprinkle-0.1.6

- old
+ new

@@ -21,10 +21,16 @@ # Check if an executable exists has_executable '/usr/bin/ruby' # Check if a global executable exists (in PATH) has_executable 'rails' + + # Check for a process + has_process 'httpd' + + # Check that ruby can include files + ruby_can_load 'a', 'b', 'c' end end @verification = @package.verifications[0] @delivery = mock(Sprinkle::Deployment, :process => true) @verification.delivery = @delivery @@ -56,10 +62,18 @@ it 'should do a "test -x" to check for an executable' do @verification.commands.should include("test -x /usr/bin/ruby") end it 'should test the "which" command to look for a global executable' do - @verification.commands.should include('[ -n "`which rails`"]') + @verification.commands.should include('[ -n "`echo \`which rails\``" ]') + end + + it 'should test the process list to find a process' do + @verification.commands.should include("ps aux | grep 'httpd' | grep -v grep") + end + + it 'should check if ruby can include a, b, c' do + @verification.commands.should include("ruby -e \"require 'rubygems';require 'a';require 'b';require 'c'\"") end end describe 'with configurations' do # Make sure it includes Sprinkle::Configurable \ No newline at end of file