Sha256: 4826f9007e1bb6512b90db9760b6c508b01b30eef25e0728d9290333a8f8925b

Contents?: true

Size: 978 Bytes

Versions: 5

Compression:

Stored size: 978 Bytes

Contents

require 'rspec'
require 'simplecov'
require 'active_rest_client'
require "ostruct"
require 'webmock/rspec'

if ENV["JENKINS"]
  require 'simplecov-rcov'
  SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
elsif ENV["TRAVIS"]
  require 'coveralls'
  Coveralls.wear!
end

RSpec.configure do |config|
  config.color = true
  # config.formatter     = 'documentation'

  config.treat_symbols_as_metadata_keys_with_true_values = true

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'
end

class TestCacheStore
  def initialize
    @items = {}
  end

  def read(key)
    @items[key]
  end

  def write(key, value, options={})
    @items[key] = value
  end

  def fetch(key, &block)
    read(key) || begin
      value = block.call
      write(value)
      value
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_rest_client-1.0.6 spec/spec_helper.rb
active_rest_client-1.0.5 spec/spec_helper.rb
active_rest_client-1.0.4 spec/spec_helper.rb
active_rest_client-1.0.3 spec/spec_helper.rb
active_rest_client-1.0.2 spec/spec_helper.rb