Sha256: cad826669422c2091289e5f2bb09a1838ef5bee04fbf9f5739fe509106704ee1
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
eac_tools-0.93.0 | sub/eac_templates/spec/lib/eac_templates/sources/set_spec.rb |
eac_tools-0.91.0 | sub/eac_templates/spec/lib/eac_templates/sources/set_spec.rb |