Skip to content

Commit

Permalink
Alias authority name to Qa::Authorities namespace
Browse files Browse the repository at this point in the history
Authority registration is a hard coded constantize within this
namespace. Pending work on a registry, this aliases `Qa::LDF::Authority`
classes to the namespace to expose them to Questioning Authority.

See: samvera/questioning_authority#137
  • Loading branch information
Tom Johnson committed Feb 22, 2017
1 parent 11c5524 commit bc16c46
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/qa/ldf/authorities/lc_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ def search_service
end
end
end

##
# Alias to hack Qa's namespaced authority logic.
#
# @see https://github.com/projecthydra-labs/questioning_authority/issues/137
module Authorities
Lcnames = LDF::LCNames
end
end
7 changes: 7 additions & 0 deletions lib/qa/ldf/spec/authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
end
end

it 'is aliased to Qa::Authorities' do
unless described_class.eql?(Qa::LDF::Authority)
name = described_class.to_s.split('::').last.downcase.camelize
expect("Qa::Authorities::#{name}".constantize).to eql described_class
end
end

describe '#all' do
it 'is enumerable' do
expect(authority.all).to respond_to :each
Expand Down

0 comments on commit bc16c46

Please sign in to comment.