Sha256: c598edf9c4f1e0c2152a3eea61240586ee7ae93148d04bdb8bdec2ef71fe5d01
Contents?: true
Size: 1.68 KB
Versions: 34
Compression:
Stored size: 1.68 KB
Contents
require 'spec_helper' require 'config_helper' describe ActiveFedora::FileConfigurator do before :all do class TestConfigurator attr_reader :fedora_config, :solr_config, :predicate_config def init(options = {}) @fedora_config = options[:fedora_config] @solr_config = options[:solr_config] @predicate_config = options[:predicate_config] end end @config_params = { :fedora_config => { :url => 'http://codeconfig.example.edu/fedora/', :user => 'fedoraAdmin', :password => 'configurator', :cert_file => '/path/to/cert/file' }, :solr_config => { :url => 'http://codeconfig.example.edu/solr/' }, :predicate_config => { :default_namespace => 'info:fedora/fedora-system:def/relations-external#', :predicate_mapping => { 'info:fedora/fedora-system:def/relations-external#' => { :has_part => 'hasPart' } } } } end before :each do ActiveFedora.configurator = TestConfigurator.new end after :all do unstub_rails # Restore to default fedora configs ActiveFedora.configurator = ActiveFedora::FileConfigurator.new restore_spec_configuration end it "should initialize from code" do YAMLAdaptor.should_receive(:load).never File.should_receive(:exists?).never File.should_receive(:read).never File.should_receive(:open).never ActiveFedora.init(@config_params) ActiveFedora.fedora_config.credentials.should == @config_params[:fedora_config] ActiveFedora.solr_config.should == @config_params[:solr_config] ActiveFedora::Predicates.predicate_mappings['info:fedora/fedora-system:def/relations-external#'].length.should == 1 end end
Version data entries
34 entries across 34 versions & 1 rubygems