Sha256: 2b17f37e590868e70e14e53787f7276edb84ccb07d63cbba8575ee3e8df7db30
Contents?: true
Size: 943 Bytes
Versions: 8
Compression:
Stored size: 943 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/templates/searcher' RSpec.describe ::EacRubyUtils::Templates::Searcher do let(:files_dir) { ::File.join(__dir__, 'searcher_spec_files') } let(:instance) do r = described_class.new r.included_paths << ::File.join(files_dir, 'path1') r.included_paths << ::File.join(files_dir, 'path2') r end describe '#template' do { ::EacRubyUtils::Templates::Directory => %w[subdir1], ::EacRubyUtils::Templates::File => %w[subdir1/file1.template subdir1/file2 subdir1/file3.template], ::NilClass => %w[does_not_exist] }.each do |klass, subpaths| subpaths.each do |subpath| context "when subpath is \"#{subpath}\"" do it "should return a #{klass}'s instance" do expect(instance.template(subpath, false)).to be_a(klass) end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems