Sha256: 1c7be0fbfe44d548c0bc3b44b8ae3840fed11a3769d26aa3557f963aa86d53db
Contents?: true
Size: 1.54 KB
Versions: 21
Compression:
Stored size: 1.54 KB
Contents
# frozen_string_literal: true require 'spec_helper' require 'generators/blacklight/solr_generator' RSpec.describe Blacklight::SolrGenerator do let(:destination) { Dir.mktmpdir } describe "#solr_wrapper_config" do let(:generator) { described_class.new } let(:files_to_test) do [ File.join(destination.to_s, '.solr_wrapper.yml') ] end before do generator.destination_root = destination generator.solr_wrapper_config end after do files_to_test.each { |file| FileUtils.rm_rf(file) } end it "creates config files" do files_to_test.each do |file| expect(File).to exist(file), "Expected #{file} to exist" end end end describe "#copy_solr_conf" do let(:generator) { described_class.new } let(:dirs_to_test) do [ File.join(destination.to_s, 'solr'), File.join(destination.to_s, 'solr/conf') ] end let(:files_to_test) do [ File.join(destination.to_s, 'solr/conf/solrconfig.xml') ] end before do generator.destination_root = destination generator.copy_solr_conf end after do dirs_to_test.each { |dir| FileUtils.rm_rf(Dir.glob(dir)) if File.directory?(dir) } end it "creates solr directory" do dirs_to_test.each do |dir| expect(File).to exist(dir), "Expected #{dir} to exist" end end it "copies solr config files" do files_to_test.each do |file| expect(File).to exist(file), "Expected #{file} to exist" end end end end
Version data entries
21 entries across 21 versions & 2 rubygems