Sha256: 898fdf349b265155f7201ec286266d6f5694232c2c65133e0c8327d07fb50163

Contents?: true

Size: 526 Bytes

Versions: 4

Compression:

Stored size: 526 Bytes

Contents

def stub_repository_read(code, body)
  kind = Net::HTTPResponse.send(:response_class, code.to_s)
  response = kind.new('1.0', code.to_s, 'HTTP MESSAGE')
  response.stubs(:read_body).returns(body)
  Puppet::Module::Tool::Repository.any_instance.stubs(:read_contact).returns(response)
end

def stub_installer_read(body)
  Puppet::Module::Tool::Applications::Installer.any_instance.stubs(:read_match).returns(body)
end

def stub_cache_read(body)
  Puppet::Module::Tool::Cache.any_instance.stubs(:read_retrieve).returns(body)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-module-0.3.4 spec/support/stub_http_support.rb
puppet-module-0.3.3 spec/support/stub_http_support.rb
puppet-module-0.3.2 spec/support/stub_http_support.rb
puppet-module-0.3.0 spec/support/stub_http_support.rb