Sha256: 7b94751417737262612cbb2c88af3de21bce0f250039a22d61bc0c06ec4e347c

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe LinkedVocabs do
  describe '#vocabularies' do
    it 'should have be a hash' do
      expect(LinkedVocabs.vocabularies).to be_a Hash
    end
  
    it 'should have prefixes' do
      LinkedVocabs.vocabularies.each_pair do |vocab, config|
        expect(config).to have_key :prefix
      end
    end
  end
  
  describe '#add_vocabulary' do
    before do
      LinkedVocabs.add_vocabulary('aat', 'http://vocab.getty.edu/aat/', :strict => false, :fetch => false)
    end

    it 'should register a vocabulary' do
      expect(LinkedVocabs.vocabularies).to have_key :aat
    end

    context 'with no source url given' do
      before do
        LinkedVocabs.add_vocabulary('lcsh', 'http://id.loc.gov/authorities/subjects/')
      end

      it 'should set strict to false ' do
        expect(LinkedVocabs.vocabularies[:lcsh][:strict]).to eq false
      end
      it 'should set fetch to false ' do
        expect(LinkedVocabs.vocabularies[:lcsh][:fetch]).to eq false
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
linked_vocabs-0.3.1 spec/linked_vocabs_spec.rb
linked_vocabs-0.3.0 spec/linked_vocabs_spec.rb
linked_vocabs-0.2.0 spec/linked_vocabs_spec.rb
linked_vocabs-0.1.0 spec/linked_vocabs_spec.rb