spec/initializer_spec.rb in local_pac-0.1.13 vs spec/initializer_spec.rb in local_pac-0.2.0
- old
+ new
@@ -4,15 +4,16 @@
describe Initializer do
context '#run' do
it 'creates all files/directories neccessary to run local_pac' do
config_string = <<-EOS.strip_heredoc
- :log_sink: #{File.join(working_directory, 'log')}
- :local_storage: #{File.join(working_directory, 'storage', 'cache.git')}
+ :access_log: #{File.join(working_directory, 'log', 'access.log')}
+ :local_storage: #{File.join(working_directory, 'data', 'storage.git')}
:executable: #{File.join(working_directory, 'bin', 'local_pac')}
: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.yaml', config_string)
config = LocalPac::Config.new(config_file)
@@ -22,13 +23,14 @@
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?('storage/cache.git')).to be_true
- expect(path_exists?(File.join('storage', 'cache.git', 'hooks', 'pre-receive'))).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("log_sink: #{File.expand_path(File.join(ENV['HOME'], '.local', 'share', 'local_pac', 'log'))}")
+ expect(result).to include("access_log: #{File.expand_path(::File.join(working_directory, 'log', 'access.log'))}")
end
end
end