require 'spec_helper' describe <%= app_name.camelize %>::Initializer do describe '#build' do it 'loads enviroment' do expect(<%= app_name.camelize %>.env).to eq ENV["TEMPLATE_ENV"] end context 'given initializers' do let(:initializer) do File.expand_path("#{File.dirname(__FILE__)}/../../../../config/initializers/sample.rb") end before :each do file = File.new(initializer, 'w') file.write "<%= app_name.camelize %>.configure { |c| c.new_key = 'New value' }" file.close <%= app_name.camelize %>::Initializer.build end after do File.delete initializer end it 'loads file' do expect(<%= app_name.camelize %>.config.new_key).to eq 'New value' end end end end