-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathconfig_spec.rb
47 lines (37 loc) · 1.29 KB
/
config_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'spec_helper'
describe Crono::Config do
let(:config) { Crono::Config.new }
describe '#initialize' do
it 'should initialize with default configuration options' do
ENV['RAILS_ENV'] = 'test'
@config = Crono::Config.new
expect(@config.cronotab).to be Crono::Config::CRONOTAB
expect(@config.logfile).to be Crono::Config::LOGFILE
expect(@config.piddir).to be Crono::Config::PIDDIR
expect(@config.process_name).to be Crono::Config::PROCESS_NAME
expect(@config.daemonize).to be false
expect(@config.monitor).to be false
expect(@config.environment).to be_eql ENV['RAILS_ENV']
end
describe "#pidfile" do
subject(:pidfile) { config.pidfile }
context "not explicity configured" do
context "daemonize is false" do
before { config.daemonize = false }
specify { expect(pidfile).to be_nil }
end
end
context "explicity configured" do
let(:path) { "foo/bar/pid.pid" }
before { config.pidfile = path }
specify { expect(pidfile).to eq path }
it "trys to set piddir" do
expect(config.piddir).to eq "foo/bar"
end
it "trys to set process_name" do
expect(config.process_name).to eq "pid"
end
end
end
end
end