Sha256: 43c1464b270d055e44a80bd0d2076991385f9f36b7eec9a50ec424c986d98c1f

Contents?: true

Size: 658 Bytes

Versions: 6

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

describe CopycopterClient::RequestSync do

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

  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)
    sync.should have_received(:flush)
  end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
copycopter_client-1.0.2 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.1 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.0 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.0.beta11 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.0.beta10 spec/copycopter_client/request_sync_spec.rb
copycopter_client-1.0.0.beta9 spec/copycopter_client/request_sync_spec.rb