Sha256: fadc039c40c9dd32008d298e32d08e202df352c519b0f5f33706778a8415a6c0
Contents?: true
Size: 1.26 KB
Versions: 25
Compression:
Stored size: 1.26 KB
Contents
# frozen_string_literal: true require 'eac_templates/interface_methods' require 'eac_templates/sources/set' RSpec.describe ::EacTemplates::Sources::Set do let(:files_dir) { ::File.join(__dir__, 'set_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 { 'subdir1' => :directory, 'subdir1/file1.template' => :file, 'subdir1/file2' => :file, 'subdir1/file3.template' => :file, 'does_not_exist' => :nil }.each do |subpath, type| context "when subpath is \"#{subpath}\"" do let(:result) { instance.template(subpath, false) } case type when :nil it { expect(result).to be_nil } when :directory ::EacTemplates::InterfaceMethods::DIRECTORY.each do |method_name| it { expect(result).to respond_to(method_name) } # rubocop:disable RSpec/RepeatedExample end when :file ::EacTemplates::InterfaceMethods::FILE.each do |method_name| it { expect(result).to respond_to(method_name) } # rubocop:disable RSpec/RepeatedExample end else ibr end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems