Sha256: 957411f4a0bfcd3a0cb8f0a88ca1eb21b0951989dd9193b5d0bb910320355846

Contents?: true

Size: 876 Bytes

Versions: 55

Compression:

Stored size: 876 Bytes

Contents

module Ddr::Models
  RSpec.describe FileCharacterization do

    subject { described_class.new(obj) }

    before {
      obj.content.checksumType = "SHA-1"
      obj.save!
    }

    let(:obj) { FactoryGirl.create(:component) }
    let(:fits_output) { "<fits/>" }

    describe "when there is an error running FITS" do
      before {
        allow(subject).to receive(:run_fits).and_raise(FileCharacterization::FITSError)
      }
      specify {
        begin
          subject.call
        rescue FileCharacterization::FITSError
        ensure
          expect(subject.fits).not_to have_content
        end
      }
    end

    describe "when FITS runs successfully" do
      before {
        allow(subject).to receive(:run_fits) { fits_output }
      }
      specify {
        subject.call
        expect(subject.fits.content).to eq(fits_output)
      }
    end

  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/models/file_characterization_spec.rb
ddr-models-2.10.2 spec/models/file_characterization_spec.rb
ddr-models-2.10.1 spec/models/file_characterization_spec.rb
ddr-models-2.10.0 spec/models/file_characterization_spec.rb
ddr-models-2.10.0.rc2 spec/models/file_characterization_spec.rb
ddr-models-2.10.0.rc1 spec/models/file_characterization_spec.rb
ddr-models-2.9.2 spec/models/file_characterization_spec.rb
ddr-models-2.9.1 spec/models/file_characterization_spec.rb
ddr-models-2.9.0 spec/models/file_characterization_spec.rb
ddr-models-2.9.0.rc1 spec/models/file_characterization_spec.rb
ddr-models-2.8.0 spec/models/file_characterization_spec.rb
ddr-models-2.8.0.rc1 spec/models/file_characterization_spec.rb
ddr-models-2.7.6 spec/models/file_characterization_spec.rb
ddr-models-2.7.5 spec/models/file_characterization_spec.rb
ddr-models-2.7.4 spec/models/file_characterization_spec.rb
ddr-models-2.7.3 spec/models/file_characterization_spec.rb
ddr-models-2.7.2 spec/models/file_characterization_spec.rb
ddr-models-2.7.1 spec/models/file_characterization_spec.rb
ddr-models-2.7.0 spec/models/file_characterization_spec.rb
ddr-models-2.7.0.rc1 spec/models/file_characterization_spec.rb