Skip to content

Commit

Permalink
Changed the invalid_tag method to non_numeric_tag (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Beck-Davis authored Apr 15, 2024
1 parent ff415de commit 280f7b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ no_001 - Record has no 001 field.

leader_errors - Errors in the leader.

invalid_tag - Tag does not consist of 3 numbers.
non_numeric_tag - Tag does not consist of 3 numbers.

invalid_indicators - Characters other than a space or a number in the field indicators.

Expand Down
2 changes: 1 addition & 1 deletion lib/marc_cleanup/record_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def non_repeatable_field_errors?(record:, schema: RECORD_SCHEMA)
!nr_fields.empty?
end

def invalid_tag?(record)
def non_numeric_tag?(record)
record.tags.find { |x| x =~ /[^0-9]/ } ? true : false
end

Expand Down
4 changes: 2 additions & 2 deletions spec/record_level/invalid_tag_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'marc_cleanup'
require 'byebug'

RSpec.describe 'invalid_tag' do
RSpec.describe 'non_numeric_tag' do
let(:fields) do
[
{ 'ABC' => { 'indicator1' => ' ',
Expand All @@ -11,6 +11,6 @@
end
let(:record) { MARC::Record.new_from_hash('fields' => fields) }
it 'finds the non-numeric tag' do
expect(MarcCleanup.invalid_tag?(record)).to eq true
expect(MarcCleanup.non_numeric_tag?(record)).to eq true
end
end

0 comments on commit 280f7b7

Please sign in to comment.