Sha256: e95c258ace781bde2c7dc7c94fbae7fc5d034228fc4f08a3562af5c3435bdfdd

Contents?: true

Size: 664 Bytes

Versions: 4

Compression:

Stored size: 664 Bytes

Contents

require 'spec_helper'

describe CopycopterClient::RequestSync do

  let(:cache) { {} }
  let(:response) { 'response' }
  let(:env) { 'env' }
  let(:app) { stub('app', :call => response) }
  before { cache.stubs(:flush => nil, :download => nil) }
  subject { CopycopterClient::RequestSync.new(app, :cache => cache) }

  it "invokes the upstream app" do
    result = subject.call(env)
    app.should have_received(:call).with(env)
    result.should == response
  end

  it "flushes defaults" do
    subject.call(env)
    cache.should have_received(:flush)
  end

  it "downloads new copy" do
    subject.call(env)
    cache.should have_received(:download)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
copycopter_client-1.1.1 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.1.0 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.4 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.3 spec/copycopter_client/request_sync_spec.rb