Sha256: b1cd49dc675d4ac35a1a1d68559a406745cc997707a741c8d14aea9ae77df6fe

Contents?: true

Size: 661 Bytes

Versions: 8

Compression:

Stored size: 661 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe "Exchange::Cache::NoCache" do
  subject { Exchange::Cache::NoCache }
  before(:all) do
    Exchange.configuration = Exchange::Configuration.new { |c|
      c.cache = {
        :subclass => :no_cache
      }
    }
  end
  after(:all) do
    Exchange.configuration.reset
  end
  describe "cached" do
    it "should directly call the block" do
      subject.cached('API_CLASS') { 'something' }.should == 'something'
    end
    it "should raise an error if no block was given" do
      lambda { subject.cached('API_CLASS') }.should raise_error(Exchange::Cache::CachingWithoutBlockError)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
exchange-1.2.2 spec/exchange/cache/no_cache_spec.rb
exchange-1.2.1 spec/exchange/cache/no_cache_spec.rb
exchange-1.2.0 spec/exchange/cache/no_cache_spec.rb
exchange-1.1.1 spec/exchange/cache/no_cache_spec.rb
exchange-1.1.0 spec/exchange/cache/no_cache_spec.rb
exchange-1.0.4 spec/exchange/cache/no_cache_spec.rb
exchange-1.0.2 spec/exchange/cache/no_cache_spec.rb
exchange-1.0.0 spec/exchange/cache/no_cache_spec.rb