diff --git a/spec/tc211/termbase_spec.rb b/spec/tc211/termbase_spec.rb index 0cc2814..11dff6f 100644 --- a/spec/tc211/termbase_spec.rb +++ b/spec/tc211/termbase_spec.rb @@ -26,11 +26,33 @@ end end - context "localized_concept count" do - let(:localized_concepts_count) { Dir.glob("concepts/localized_concept/*").count } + context "localized_concept" do + describe "validate count" do + let(:localized_concepts_count) do + Dir.glob("concepts/localized_concept/*").count + end - it "should to be 193" do - expect(localized_concepts_count).to eq(193) + it "should to be 193" do + expect(localized_concepts_count).to eq(193) + end + end + + describe "validate uuids" do + let(:localized_concept_files) do + Dir.glob("concepts/localized_concept/*") + end + + it "should match filenames to ids" do + localized_concept_files.each do |localized_concept_file| + filename = File.basename(localized_concept_file, ".yaml") + localized_concept = YAML.safe_load( + File.read(localized_concept_file), + permitted_classes: [Date, Time], + ) + + expect(localized_concept["id"]).to eq(filename) + end + end end end diff --git a/tc211-termbase.gemspec b/tc211-termbase.gemspec index d07bb8d..b54bc30 100644 --- a/tc211-termbase.gemspec +++ b/tc211-termbase.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "creek" spec.add_runtime_dependency "relaton" - spec.add_runtime_dependency "glossarist", "~> 2.0" + spec.add_runtime_dependency "glossarist", "~> 2.1" spec.add_development_dependency "bundler" spec.add_development_dependency "rake", "~> 13.0"