# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide. # # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use, # reproduction, modification, or disclosure of this program is # strictly prohibited. Any use of this program by an authorized # licensee is strictly subject to the terms and conditions, # including confidentiality obligations, set forth in the applicable # License Agreement between RightScale.com, Inc. and # the licensee require 'rubygems' require 'rspec' require "flexmock" require File.join(File.dirname(__FILE__), '..', 'lib', 'rconf') RSpec.configure do |c| c.mock_with(:flexmock) end # Helper method to mock Command.execute # # === Parameters # Parameters are passed through to flexmock 'with' method # # === Return # mock(Flexmock):: Corresponding flexmock instance def should_execute(*with) mock = flexmock(RightConf::Command.instance).should_receive(:execute).with(*with) end # Helper method to mock Command.execute_in_ruby # # === Parameters # Parameters are passed through to flexmock 'with' method # # === Return # mock(Flexmock):: Corresponding flexmock instance def should_execute_in_ruby(*with) mock = flexmock(RightConf::Command.instance).should_receive(:execute_in_ruby).with(*with) end # Helper method to mock Command.sudo # # === Parameters # Parameters are passed through to flexmock 'with' method # # === Return # mock(Flexmock):: Corresponding flexmock instance def should_sudo(*with) mock = flexmock(RightConf::Command.instance).should_receive(:sudo).with(*with) end