Sha256: 5c10f48ac72f5b0372c2d3b429b8a8c3c77b31b735cab3ec9a33778cb1329410
Contents?: true
Size: 949 Bytes
Versions: 14
Compression:
Stored size: 949 Bytes
Contents
require 'spec_helper' describe "Checking fixity" do before(:all) do class MockAFBase < ActiveFedora::Base has_subresource "data", autocreate: true end end after(:all) do Object.send(:remove_const, :MockAFBase) end subject do obj = MockAFBase.create obj.data.content = "some content" obj.save obj.data end context "with a valid resource" do it "returns true for a successful fixity check" do expect(subject.check_fixity).to be true end end context "when no uri has been set" do subject { ActiveFedora::File.new } it "raises an error" do expect { subject.check_fixity }.to raise_error(ArgumentError, "You must provide a uri") end end context "with missing resource" do subject { ActiveFedora::File.new(ActiveFedora::Base.id_to_uri('123')) } it "raises an error" do expect { subject.check_fixity }.to raise_error(Ldp::NotFound) end end end
Version data entries
14 entries across 14 versions & 1 rubygems