Sha256: 8e5582d525832ca215826e8184af9ddc27c71d8c3ccd04b1bd833ef48a635441

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

# 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rconf-0.7.8 spec/spec_helper.rb