Sha256: c92bc3f246a3cd65224c90df27d4ffd5b9e080a99d0c6cc112c95b4ed22e61ac

Contents?: true

Size: 883 Bytes

Versions: 9

Compression:

Stored size: 883 Bytes

Contents

require 'fakeweb'
require 'httparty'
require 'active_support'

require 'osm'

FakeWeb.allow_net_connect = false


RSpec.configure do |config|
  # == Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec

  config.before(:each) do
    FakeWeb.clean_registry
    Rails.cache.clear
  end
end


module Rails
  def self.cache
    @cache ||= Cache.new
  end
  def self.env
    Env.new
  end

  class Env
    def development?
      false
    end
  end

  class Cache
    def initialize
      @cache = {}
    end
    def write(key, data, options={})
      @cache[key] = data
    end
    def read(key)
      @cache[key]
    end
    def exist?(key)
      @cache.include?(key)
    end
    def clear
      @cache = {}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
osm-0.0.8 spec/spec_helper.rb
osm-0.0.7 spec/spec_helper.rb
osm-0.0.6 spec/spec_helper.rb
osm-0.0.5 spec/spec_helper.rb
osm-0.0.4 spec/spec_helper.rb
osm-0.0.3 spec/spec_helper.rb
osm-0.0.2 spec/spec_helper.rb
osm-0.0.1 spec/spec_helper.rb
osm-0.0.1.alpha spec/spec_helper.rb