mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-29 03:01:58 +08:00
Add protocol base normalizer class
This commit is contained in:
parent
c1cee07a63
commit
ec49388283
2 changed files with 28 additions and 0 deletions
13
app/utilities/protocol_importers/protocol_normalizer.rb
Normal file
13
app/utilities/protocol_importers/protocol_normalizer.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module ProtocolImporters
|
||||||
|
class ProtocolNormalizer
|
||||||
|
def load_all_protocols(_params: {})
|
||||||
|
raise NotImplementedError
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_protocol(_id:, _params: {})
|
||||||
|
raise NotImplementedError
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,15 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe ProtocolImporters::ProtocolNormalizer do
|
||||||
|
describe '.load_all_protocols' do
|
||||||
|
it { expect { subject.load_all_protocols }.to raise_error(NotImplementedError) }
|
||||||
|
it { expect { subject.load_all_protocols(_params: 'some-params') }.to raise_error(NotImplementedError) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe '.load_protocol' do
|
||||||
|
it { expect { subject.load_protocol(_id: 'random-id') }.to raise_error(NotImplementedError) }
|
||||||
|
it { expect { subject.load_protocol(_id: 'random-id', _params: 'someparams') }.to raise_error(NotImplementedError) }
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue