Sha256: 417693aba12b417eb8a5bf1987f1d2232c7747dee25427241176a764a7d9ada6

Contents?: true

Size: 807 Bytes

Versions: 56

Compression:

Stored size: 807 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::File::Streaming do
  let(:test_class) do
    tc = Class.new
    tc.send(:include, described_class)
    tc
  end
  let(:streamer) do
    streamer = test_class.new
    allow(streamer).to receive(:uri).and_return(uri)
    allow(streamer).to receive(:authorization_key).and_return("authorization_key")
    streamer
  end

  context "without ssl" do
    let(:uri) { "http://localhost/file/1" }

    it do
      expect(Net::HTTP).to receive(:start).with('localhost', 80, use_ssl: false).and_return(nil)
      streamer.stream.each
    end
  end

  context "with ssl" do
    let(:uri) { "https://localhost/file/1" }

    it do
      expect(Net::HTTP).to receive(:start).with('localhost', 443, use_ssl: true).and_return(nil)
      streamer.stream.each
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
active-fedora-12.2.4 spec/unit/file/streaming_spec.rb
active-fedora-12.2.3 spec/unit/file/streaming_spec.rb
active-fedora-11.5.6 spec/unit/file/streaming_spec.rb
active-fedora-12.2.2 spec/unit/file/streaming_spec.rb
active-fedora-11.2.1 spec/unit/file/streaming_spec.rb
active-fedora-12.2.1 spec/unit/file/streaming_spec.rb
active-fedora-12.0.3 spec/unit/file/streaming_spec.rb
active-fedora-11.5.5 spec/unit/file/streaming_spec.rb
active-fedora-13.1.2 spec/unit/file/streaming_spec.rb
active-fedora-13.1.1 spec/unit/file/streaming_spec.rb
active-fedora-13.1.0 spec/unit/file/streaming_spec.rb
active-fedora-13.0.0 spec/unit/file/streaming_spec.rb
active-fedora-12.1.1 spec/unit/file/streaming_spec.rb
active-fedora-12.1.0 spec/unit/file/streaming_spec.rb
active-fedora-11.5.4 spec/unit/file/streaming_spec.rb
active-fedora-11.5.3 spec/unit/file/streaming_spec.rb
active-fedora-12.0.2 spec/unit/file/streaming_spec.rb
active-fedora-12.0.1 spec/unit/file/streaming_spec.rb
active-fedora-11.5.2 spec/unit/file/streaming_spec.rb
active-fedora-12.0.0 spec/unit/file/streaming_spec.rb