Sha256: d353b3e22e13ee3a5959d69de94a610b684cec4638b7f50249b2fbded2e0bf06

Contents?: true

Size: 937 Bytes

Versions: 87

Compression:

Stored size: 937 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 "returns a #{klass}'s instance" do
            expect(instance.template(subpath, false)).to be_a(klass)
          end
        end
      end
    end
  end
end

Version data entries

87 entries across 87 versions & 2 rubygems

Version Path
avm-tools-0.98.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.97.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.96.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.95.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.94.3 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.94.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.94.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
ehbrs-tools-0.20.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.94.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.93.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.92.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.91.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.90.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.89.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.88.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.87.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
ehbrs-tools-0.19.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
ehbrs-tools-0.18.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
avm-tools-0.87.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb
ehbrs-tools-0.17.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/searcher_spec.rb