Sha256: 2f93b6ed9721a4e7c148f521d5a9950e22c43c633d3ea371482ff42a77191805
Contents?: true
Size: 907 Bytes
Versions: 1
Compression:
Stored size: 907 Bytes
Contents
# encoding: utf-8 require 'spec_helper' require 'configstruct' describe ConfigStruct do let(:basedir) { File.expand_path('../../files', __FILE__) } let(:basefile) { File.expand_path('../../files/config.yml', __FILE__) } let(:options) { { basedir: basedir, basefile: basefile } } let(:value1) { 'newdefault' } describe '.default' do subject { ConfigStruct.new options } before { subject.default :var, value1 } it { expect(subject.var).to eq value1 } end describe 'new' do context 'when there is no config file, ' do let(:basefile) { File.expand_path('../../files/xxx.yml', __FILE__) } after { FileUtils.rm basefile if File.exist? basefile } subject { ConfigStruct.new options } it 'then a config file is created calling' do expect(subject.basefile).to eq basefile expect(File.exist? basefile).to be_true end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
configstruct-0.0.2 | spec/lib/configstruct_spec.rb |