spec/unit/metadata_spec.rb in ezid-client-0.10.0 vs spec/unit/metadata_spec.rb in ezid-client-0.11.0
- old
+ new
@@ -66,13 +66,11 @@
end
end
describe "custom element" do
let(:element) { Metadata::Element.new("custom", true) }
- before do
- allow(subject.registered_elements).to receive(:include?).with(:custom) { true }
- allow(subject.registered_elements).to receive(:[]).with(:custom) { element }
- end
+ before { described_class.register_element :custom }
+ after { described_class.send(:unregister_element, :custom) }
it "should have a reader" do
expect(subject).to receive(:reader).with("custom")
subject.custom
end
it "should have a writer" do