spec/initializer_spec.rb in local_pac-0.3.0 vs spec/initializer_spec.rb in local_pac-0.4.0

- old
+ new

@@ -12,27 +12,35 @@ :pid_file: #{File.join(working_directory, 'run', 'pid')} :sass_cache: #{File.join(working_directory, 'cache', 'sass')} :config_file: #{File.join(working_directory, 'config', 'config.yaml')} :gem_path: [] EOS - config_file = create_file('config_spec.yaml', config_string) - config = LocalPac::Config.new(config_file) - initializer = Initializer.new({}, config) - result = capture(:stdout) do - silence(:stderr) do - initializer.run - end + config_file = create_file('config_spec.yaml', config_string) + + config = LocalPac::Config.new(config_file) + initializer = Initializer.new({ + create_pid_directory: true, + create_log_directory: true, + create_sass_cache: true, + create_local_storage: true, + create_pre_receive_hook: true, + create_config_file: true, + }, config) + result = capture(:stdout) do + silence(:stderr) do + initializer.run end + end - expect(path_exists?('log')).to be_true - expect(path_exists?('config/config.yaml')).to be_true - expect(path_exists?('cache/sass')).to be_true - expect(path_exists?('data/storage.git')).to be_true - expect(path_exists?(::File.join('data', 'storage.git', 'hooks', 'pre-receive'))).to be_true - expect(path_exists?('run')).to be_true - expect(result).to include("access_log: #{File.expand_path(::File.join(working_directory, 'log', 'access.log'))}") + expect(path_exists?('log')).to be_true + expect(path_exists?('config/config.yaml')).to be_true + expect(path_exists?('cache/sass')).to be_true + expect(path_exists?('data/storage.git')).to be_true + expect(path_exists?(::File.join('data', 'storage.git', 'hooks', 'pre-receive'))).to be_true + expect(path_exists?('run')).to be_true + expect(result).to include("access_log: #{File.expand_path(::File.join(working_directory, 'log', 'access.log'))}") end it 'adds examples on request' do config_string = <<-EOS.strip_heredoc :access_log: #{File.join(working_directory, 'log', 'access.log')} @@ -44,10 +52,13 @@ :gem_path: [] EOS config_file = create_file('config_spec.yaml', config_string) config = LocalPac::Config.new(config_file) - initializer = Initializer.new({pre_seed: true}, config) + initializer = Initializer.new({ + pre_seed: true, + create_local_storage: true, + }, config) silence(:stdout) do silence(:stderr) do initializer.run end end