Sha256: e3f0485000e9d879ab20826729f3b076fed53e21f9e29f9b2cfbaa9867b551e6

Contents?: true

Size: 781 Bytes

Versions: 14

Compression:

Stored size: 781 Bytes

Contents

require 'spec_helper'
require 'stringio'

describe Hydra::Derivatives::IoDecorator do
  let(:file) { StringIO.new('hello') }

  context "one argument" do
    let(:decorator) { described_class.new(file) }
    describe "#read" do
      subject { decorator.read }
      it { is_expected.to eq 'hello' }
    end
  end

  context "three arguments" do
    let(:decorator) { described_class.new(file, 'text/plain', 'help.txt') }

    describe "#read" do
      subject { decorator.read }
      it { is_expected.to eq 'hello' }
    end

    describe "mime_type" do
      subject { decorator.mime_type }
      it { is_expected.to eq 'text/plain' }
    end

    describe "original_name" do
      subject { decorator.original_name }
      it { is_expected.to eq 'help.txt' }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hydra-derivatives-3.3.2 spec/units/io_decorator_spec.rb
hydra-derivatives-3.3.1 spec/units/io_decorator_spec.rb
hydra-derivatives-3.3.0 spec/units/io_decorator_spec.rb
hydra-derivatives-3.2.2 spec/units/io_decorator_spec.rb
hydra-derivatives-3.2.1 spec/units/io_decorator_spec.rb
hydra-derivatives-3.2.0 spec/units/io_decorator_spec.rb
hydra-derivatives-3.1.4 spec/units/io_decorator_spec.rb
hydra-derivatives-3.1.3 spec/units/io_decorator_spec.rb
hydra-derivatives-3.1.2 spec/units/io_decorator_spec.rb
hydra-derivatives-3.1.1 spec/units/io_decorator_spec.rb
hydra-derivatives-3.1.0 spec/units/io_decorator_spec.rb
hydra-derivatives-3.0.2 spec/units/io_decorator_spec.rb
hydra-derivatives-3.0.1 spec/units/io_decorator_spec.rb
hydra-derivatives-3.0.0 spec/units/io_decorator_spec.rb