Class: Gem::FakeFetcher

Class | Gem::FakeFetcher
In: | lib/rubygems/test_utilities.rb
Parent: | Object

A fake Gem::RemoteFetcher for use in tests or to avoid real live HTTP requests when testing code that uses RubyGems.

Example:

      @fetcher = Gem::FakeFetcher.new
      @fetcher.data['http://gems.example.com/yaml'] = source_index.to_yaml
      Gem::RemoteFetcher.fetcher = @fetcher

      # invoke RubyGems code

      paths = @fetcher.paths
      assert_equal 'http://gems.example.com/yaml', paths.shift
      assert paths.empty?, paths.join(', ')

See RubyGems’ tests for more examples of FakeFetcher.

### Methods

download fetch_path fetch_size new

### Attributes

data | [R] |
paths | [RW] |

### Public Class methods

new()

### Public Instance methods

download(spec, source_uri, install_dir = Gem.dir)
fetch_path(path, mtime = nil)
fetch_size(path)

[Validate]