Sha256: 549750d7486e9a69d2c5a6f2ea847d2eea2c1799c0a1caaffab68ea461297081

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

module StaleFish

  class << self
    attr_accessor :use_fakeweb
  end

  self.use_fakeweb = true

  class FixtureDefinition
    alias_method :update_without_fakeweb, :update!

    def update!
      FakeWeb.allow_net_connect = true
      update_without_fakeweb
      FakeWeb.allow_net_connect = false
    end

    def register_uri
      if StaleFish.use_fakeweb && !FakeWeb.registered_uri?(:any, source_url)
        FakeWeb.register_uri(:any, source_url, :body => file_path)
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stale_fish-1.2.4 lib/stale_fish/fakeweb.rb
stale_fish-1.2.3 lib/stale_fish/fakeweb.rb