Sha256: 63745af5334e185bad0d334e76789ee6394f27c732fd50d4e7cadf0248dee18e
Contents?: true
Size: 1.03 KB
Versions: 69
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true require 'eac_config/old_configs' require 'eac_templates/file' RSpec.describe ::EacTemplates::File do let(:files_dir) { ::File.join(__dir__, 'file_spec_files') } let(:source_path) { ::File.join(files_dir, 'source.template') } let(:instance) { described_class.new(source_path) } let(:expected_content) { ::File.read(::File.join(files_dir, 'expected_content')) } describe '#apply' do context 'when config is a hash' do let(:config) { { name: 'Fulano de Tal', age: 33 } } it { expect(instance.apply(config)).to eq(expected_content) } end context 'when config responds to read_entry' do let(:config) { ::EacConfig::OldConfigs.new('rspec_describe_eac_ruby_utils_templates_file') } before do config.clear config['name'] = 'Fulano de Tal' config['age'] = '33' end it { expect(instance.apply(config)).to eq(expected_content) } end end describe '#variables' do it { expect(instance.variables).to eq(::Set.new(%w[name age])) } end end
Version data entries
69 entries across 69 versions & 3 rubygems