diff --git a/lib/sierra_postgres_utilities/data/records/deleted.rb b/lib/sierra_postgres_utilities/data/records/deleted.rb index 6a32804..3a3c2c4 100644 --- a/lib/sierra_postgres_utilities/data/records/deleted.rb +++ b/lib/sierra_postgres_utilities/data/records/deleted.rb @@ -17,7 +17,7 @@ def deleted? # We don't know whether it was a bib/item/other_record_type method # being called on this deleted record, but we want to warn especially # in case it was. - def method_missing + def method_missing(method_name, *arguments, &block) raise DeletedRecordError, "Deleted record #{record_type_code}" \ "#{record_num} lacks methods associated with undeleted records." end diff --git a/lib/sierra_postgres_utilities/version.rb b/lib/sierra_postgres_utilities/version.rb index 3fa803b..e3e6979 100644 --- a/lib/sierra_postgres_utilities/version.rb +++ b/lib/sierra_postgres_utilities/version.rb @@ -1,3 +1,3 @@ module Sierra - VERSION = '0.3.0'.freeze + VERSION = '0.3.1'.freeze end diff --git a/spec/data/record/deleted_spec.rb b/spec/data/record/deleted_spec.rb new file mode 100644 index 0000000..c7a29eb --- /dev/null +++ b/spec/data/record/deleted_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +describe Sierra::Data::DeletedRecord do + let(:rec) { Sierra::Data::Metadata.first.extend Sierra::Data::DeletedRecord } + + it 'raises a DeletedRecordError on method_missing' do + expect{ rec.non_existent_method }. + to raise_error(Sierra::Data::DeletedRecord::DeletedRecordError) + end +end