foreman 0.67.0 → 0.69.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +14 -0
  3. data/data/export/upstart/process.conf.erb +1 -1
  4. data/lib/foreman.rb +0 -2
  5. data/lib/foreman/cli.rb +0 -9
  6. data/lib/foreman/engine.rb +28 -22
  7. data/lib/foreman/process.rb +2 -51
  8. data/lib/foreman/version.rb +1 -1
  9. data/man/foreman.1 +1 -1
  10. data/spec/foreman/cli_spec.rb +18 -26
  11. data/spec/foreman/engine_spec.rb +13 -13
  12. data/spec/foreman/export/base_spec.rb +1 -1
  13. data/spec/foreman/export/bluepill_spec.rb +2 -2
  14. data/spec/foreman/export/daemon_spec.rb +12 -12
  15. data/spec/foreman/export/inittab_spec.rb +2 -2
  16. data/spec/foreman/export/launchd_spec.rb +3 -3
  17. data/spec/foreman/export/runit_spec.rb +12 -12
  18. data/spec/foreman/export/supervisord_spec.rb +2 -2
  19. data/spec/foreman/export/systemd_spec.rb +13 -13
  20. data/spec/foreman/export/upstart_spec.rb +14 -14
  21. data/spec/foreman/helpers_spec.rb +4 -4
  22. data/spec/foreman/process_spec.rb +29 -6
  23. data/spec/foreman/procfile_spec.rb +9 -9
  24. data/spec/foreman_spec.rb +1 -1
  25. data/spec/helper_spec.rb +3 -2
  26. data/spec/resources/export/bluepill/app-concurrency.pill +2 -2
  27. data/spec/resources/export/bluepill/app.pill +4 -4
  28. data/spec/resources/export/runit/app-alpha-1/run +1 -0
  29. data/spec/resources/export/runit/app-alpha-2/run +1 -0
  30. data/spec/resources/export/runit/app-bravo-1/run +1 -0
  31. data/spec/resources/export/systemd/{app-alpha-1.service → concurrency/app-alpha-1.service} +0 -3
  32. data/spec/resources/export/systemd/{app-alpha-2.service → concurrency/app-alpha-2.service} +0 -3
  33. data/spec/resources/export/systemd/concurrency/app-alpha.target +3 -0
  34. data/spec/resources/export/systemd/concurrency/app.target +6 -0
  35. data/spec/resources/export/systemd/standard/app-alpha-1.service +14 -0
  36. data/spec/resources/export/systemd/standard/app-alpha.target +3 -0
  37. data/spec/resources/export/systemd/{app-bravo-1.service → standard/app-bravo-1.service} +0 -3
  38. data/spec/resources/export/systemd/standard/app-bravo.target +3 -0
  39. data/spec/resources/export/systemd/standard/app.target +6 -0
  40. data/spec/resources/export/upstart/app-alpha-1.conf +7 -1
  41. data/spec/resources/export/upstart/app-alpha-2.conf +7 -1
  42. data/spec/resources/export/upstart/app-bravo-1.conf +7 -1
  43. data/spec/resources/export/upstart/app.conf +1 -11
  44. data/spec/spec_helper.rb +8 -23
  45. metadata +16 -25
  46. data/spec/resources/export/systemd/app-alpha.target +0 -5
  47. data/spec/resources/export/systemd/app-bravo.target +0 -5
  48. data/spec/resources/export/systemd/app.target +0 -1
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0a6aaa548eacdb897d972630d93888f827c450a7
4
+ data.tar.gz: c27ab03e629eb432b3581f52e0ecd5d18984a3bd
5
+ SHA512:
6
+ metadata.gz: a92c7f5a963fb537f22bb72899029b35ac75059c5a2714230860dfb96e96ad9977a111f3fc429dc7b697c357c9db6c0ec50ba7eb156a89bb01166d54d0589741
7
+ data.tar.gz: eda6704c18eb6ca854059f6e7bfecdcb01a0476f3b83b2ff96a87e0d73b5a8ff7989bfd7268d40b8afe0349be5802f99ba10f60177c2d1cae7d12c88b3162755
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Foreman
2
2
 
3
+ [![Build Status](https://travis-ci.org/ddollar/foreman.svg?branch=master)](https://travis-ci.org/ddollar/foreman)
4
+ [![Code Climate](https://codeclimate.com/github/ddollar/foreman.png)](https://codeclimate.com/github/ddollar/foreman)
5
+
3
6
  Manage Procfile-based applications
4
7
 
5
8
  <table>
@@ -17,10 +20,21 @@ Manage Procfile-based applications
17
20
  </tr>
18
21
  </table>
19
22
 
23
+ ## Installation
24
+
25
+ $ gem install foreman
26
+
27
+ Ruby users should take care *not* to install foreman in their project's `Gemfile`.
28
+
20
29
  ## Getting Started
21
30
 
22
31
  * http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
23
32
 
33
+ ## Supported Ruby versions
34
+
35
+ * 1.9.3
36
+ * 2.0.0
37
+
24
38
  ## Documentation
25
39
 
26
40
  * [man page](http://ddollar.github.com/foreman)
@@ -11,4 +11,4 @@ setuid <%= user %>
11
11
 
12
12
  chdir <%= engine.root %>
13
13
 
14
- exec <%= process.command %>
14
+ exec <%= process.command %> >> <%= log %>/<%=name%>-<%=num%>.log 2>&1
data/lib/foreman.rb CHANGED
@@ -2,8 +2,6 @@ require "foreman/version"
2
2
 
3
3
  module Foreman
4
4
 
5
- class AppDoesNotExist < Exception; end
6
-
7
5
  def self.runner
8
6
  File.expand_path("../../bin/foreman-runner", __FILE__)
9
7
  end
data/lib/foreman/cli.rb CHANGED
@@ -34,7 +34,6 @@ class Foreman::CLI < Thor
34
34
  end
35
35
 
36
36
  def start(process=nil)
37
- require_posix_spawn_for_ruby_18!
38
37
  check_procfile!
39
38
  load_environment!
40
39
  engine.load_procfile(procfile)
@@ -139,14 +138,6 @@ private ######################################################################
139
138
  end
140
139
  end
141
140
 
142
- def require_posix_spawn_for_ruby_18!
143
- begin
144
- Kernel.require 'posix/spawn' # Use Kernel explicitly so we can mock the require call in the spec
145
- rescue LoadError
146
- error "foreman requires gem `posix-spawn` on Ruby #{RUBY_VERSION}. Please `gem install posix-spawn`."
147
- end if Foreman.ruby_18?
148
- end
149
-
150
141
  def procfile
151
142
  case
152
143
  when options[:procfile] then options[:procfile]
@@ -367,33 +367,39 @@ private
367
367
  end
368
368
  end
369
369
 
370
+ def read_self_pipe
371
+ @selfpipe[:reader].read_nonblock(11)
372
+ rescue Errno::EAGAIN, Errno::EINTR => err
373
+ # ignore
374
+ end
375
+
376
+ def handle_signals
377
+ while sig = Thread.main[:signal_queue].shift
378
+ self.handle_signal(sig)
379
+ end
380
+ end
381
+
382
+ def handle_io(readers)
383
+ readers.each do |reader|
384
+ next if reader == @selfpipe[:reader]
385
+
386
+ if reader.eof?
387
+ @readers.delete_if { |key, value| value == reader }
388
+ else
389
+ data = reader.gets
390
+ output_with_mutex name_for(@readers.invert[reader]), data
391
+ end
392
+ end
393
+ end
394
+
370
395
  def watch_for_output
371
396
  Thread.new do
372
397
  begin
373
398
  loop do
374
399
  io = IO.select([@selfpipe[:reader]] + @readers.values, nil, nil, 30)
375
-
376
- begin
377
- @selfpipe[:reader].read_nonblock(11)
378
- rescue Errno::EAGAIN, Errno::EINTR => err
379
- # ignore
380
- end
381
-
382
- # Look for any signals that arrived and handle them
383
- while sig = Thread.main[:signal_queue].shift
384
- self.handle_signal(sig)
385
- end
386
-
387
- (io.nil? ? [] : io.first).each do |reader|
388
- next if reader == @selfpipe[:reader]
389
-
390
- if reader.eof?
391
- @readers.delete_if { |key, value| value == reader }
392
- else
393
- data = reader.gets
394
- output_with_mutex name_for(@readers.invert[reader]), data
395
- end
396
- end
400
+ read_self_pipe
401
+ handle_signals
402
+ handle_io(io ? io.first : [])
397
403
  end
398
404
  rescue Exception => ex
399
405
  puts ex.message
@@ -50,17 +50,8 @@ class Foreman::Process
50
50
  output = options[:output] || $stdout
51
51
  runner = "#{Foreman.runner}".shellescape
52
52
 
53
- if Foreman.windows?
54
- Dir.chdir(cwd) do
55
- Process.spawn env, expanded_command(env), :out => output, :err => output
56
- end
57
- elsif Foreman.jruby_18? || Foreman.ruby_18?
58
- require "posix/spawn"
59
- wrapped_command = "#{runner} -d '#{cwd.shellescape}' -p -- #{expanded_command(env)}"
60
- POSIX::Spawn.spawn(*spawn_args(env, wrapped_command.shellsplit, {:out => output, :err => output}))
61
- else
62
- wrapped_command = "exec #{runner} -d '#{cwd.shellescape}' -p -- #{command}"
63
- Process.spawn env, wrapped_command, :out => output, :err => output
53
+ Dir.chdir(cwd) do
54
+ Process.spawn env, expanded_command(env), :out => output, :err => output
64
55
  end
65
56
  end
66
57
 
@@ -78,36 +69,6 @@ class Foreman::Process
78
69
  Kernel.exec expanded_command(env)
79
70
  end
80
71
 
81
- # Send a signal to this +Process+
82
- #
83
- # @param [String] signal The signal to send
84
- #
85
- def kill(signal)
86
- if Foreman.windows?
87
- pid && Process.kill(signal, pid)
88
- else
89
- pid && Process.kill("-#{signal}", pid)
90
- end
91
- rescue Errno::ESRCH
92
- false
93
- end
94
-
95
- # Test whether or not this +Process+ is still running
96
- #
97
- # @returns [Boolean]
98
- #
99
- def alive?
100
- kill(0)
101
- end
102
-
103
- # Test whether or not this +Process+ has terminated
104
- #
105
- # @returns [Boolean]
106
- #
107
- def dead?
108
- !alive?
109
- end
110
-
111
72
  # Returns the working directory for this +Process+
112
73
  #
113
74
  # @returns [String]
@@ -116,14 +77,4 @@ class Foreman::Process
116
77
  File.expand_path(@options[:cwd] || ".")
117
78
  end
118
79
 
119
- private
120
-
121
- def spawn_args(env, argv, options)
122
- args = []
123
- args << env
124
- args += argv
125
- args << options
126
- args
127
- end
128
-
129
80
  end
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.67.0"
3
+ VERSION = "0.69.0"
4
4
 
5
5
  end
data/man/foreman.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "FOREMAN" "1" "April 2014" "Foreman 0.67.0" "Foreman Manual"
4
+ .TH "FOREMAN" "1" "May 2014" "Foreman 0.69.0" "Foreman Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBforeman\fR \- manage Procfile\-based applications
@@ -8,12 +8,12 @@ describe "Foreman::CLI", :fakefs do
8
8
  before { File.open(".foreman", "w") { |f| f.puts "formation: alpha=2" } }
9
9
 
10
10
  it "provides default options" do
11
- subject.send(:options)["formation"].should == "alpha=2"
11
+ expect(subject.send(:options)["formation"]).to eq("alpha=2")
12
12
  end
13
13
 
14
14
  it "is overridden by options at the cli" do
15
15
  subject = Foreman::CLI.new([], :formation => "alpha=3")
16
- subject.send(:options)["formation"].should == "alpha=3"
16
+ expect(subject.send(:options)["formation"]).to eq("alpha=3")
17
17
  end
18
18
  end
19
19
 
@@ -31,24 +31,24 @@ describe "Foreman::CLI", :fakefs do
31
31
  it "can run a single command" do
32
32
  without_fakefs do
33
33
  output = foreman("start env -f #{resource_path("Procfile")}")
34
- output.should =~ /env.1/
35
- output.should_not =~ /test.1/
34
+ expect(output).to match(/env.1/)
35
+ expect(output).not_to match(/test.1/)
36
36
  end
37
37
  end
38
38
 
39
39
  it "can run all commands" do
40
40
  without_fakefs do
41
41
  output = foreman("start -f #{resource_path("Procfile")} -e #{resource_path(".env")}")
42
- output.should =~ /echo.1 \| echoing/
43
- output.should =~ /env.1 \| bar/
44
- output.should =~ /test.1 \| testing/
42
+ expect(output).to match(/echo.1 \| echoing/)
43
+ expect(output).to match(/env.1 \| bar/)
44
+ expect(output).to match(/test.1 \| testing/)
45
45
  end
46
46
  end
47
47
 
48
48
  it "sets PS variable with the process name" do
49
49
  without_fakefs do
50
50
  output = foreman("start -f #{resource_path("Procfile")}")
51
- output.should =~ /ps.1 \| PS env var is ps.1/
51
+ expect(output).to match(/ps.1 \| PS env var is ps.1/)
52
52
  end
53
53
  end
54
54
  end
@@ -57,55 +57,47 @@ describe "Foreman::CLI", :fakefs do
57
57
  describe "check" do
58
58
  it "with a valid Procfile displays the jobs" do
59
59
  write_procfile
60
- foreman("check").should == "valid procfile detected (alpha, bravo, foo_bar, foo-bar)\n"
60
+ expect(foreman("check")).to eq("valid procfile detected (alpha, bravo, foo_bar, foo-bar)\n")
61
61
  end
62
62
 
63
63
  it "with a blank Procfile displays an error" do
64
64
  FileUtils.touch "Procfile"
65
- foreman("check").should == "ERROR: no processes defined\n"
65
+ expect(foreman("check")).to eq("ERROR: no processes defined\n")
66
66
  end
67
67
 
68
68
  it "without a Procfile displays an error" do
69
69
  FileUtils.rm_f "Procfile"
70
- foreman("check").should == "ERROR: Procfile does not exist.\n"
70
+ expect(foreman("check")).to eq("ERROR: Procfile does not exist.\n")
71
71
  end
72
72
  end
73
73
 
74
74
  describe "run" do
75
75
  it "can run a command" do
76
- forked_foreman("run echo 1").should == "1\n"
76
+ expect(forked_foreman("run echo 1")).to eq("1\n")
77
77
  end
78
78
 
79
79
  it "includes the environment" do
80
- forked_foreman("run #{resource_path("bin/env FOO")} -e #{resource_path(".env")}").should == "bar\n"
80
+ expect(forked_foreman("run #{resource_path("bin/env FOO")} -e #{resource_path(".env")}")).to eq("bar\n")
81
81
  end
82
82
 
83
83
  it "can run a command from the Procfile" do
84
- forked_foreman("run -f #{resource_path("Procfile")} test").should == "testing\n"
84
+ expect(forked_foreman("run -f #{resource_path("Procfile")} test")).to eq("testing\n")
85
85
  end
86
86
 
87
87
  it "exits with the same exit code as the command" do
88
- fork_and_get_exitstatus("run echo 1").should == 0
89
- fork_and_get_exitstatus("run date 'invalid_date'").should == 1
88
+ expect(fork_and_get_exitstatus("run echo 1")).to eq(0)
89
+ expect(fork_and_get_exitstatus("run date 'invalid_date'")).to eq(1)
90
90
  end
91
91
  end
92
92
 
93
93
  describe "version" do
94
94
  it "displays gem version" do
95
- foreman("version").chomp.should == Foreman::VERSION
95
+ expect(foreman("version").chomp).to eq(Foreman::VERSION)
96
96
  end
97
97
 
98
98
  it "displays gem version on shortcut command" do
99
- foreman("-v").chomp.should == Foreman::VERSION
99
+ expect(foreman("-v").chomp).to eq(Foreman::VERSION)
100
100
  end
101
101
  end
102
102
 
103
- describe "when posix-spawn is not present on ruby 1.8" do
104
- it "should fail with an error" do
105
- mock(Kernel).require('posix/spawn') { raise LoadError }
106
- output = foreman("start -f #{resource_path("Procfile")}")
107
- output.should == "ERROR: foreman requires gem `posix-spawn` on Ruby #{RUBY_VERSION}. Please `gem install posix-spawn`.\n"
108
- end
109
- end if running_ruby_18?
110
-
111
103
  end
@@ -27,8 +27,8 @@ describe "Foreman::Engine", :fakefs do
27
27
  before { write_procfile }
28
28
 
29
29
  it "reads the processes" do
30
- subject.process("alpha").command.should == "./alpha"
31
- subject.process("bravo").command.should == "./bravo"
30
+ expect(subject.process("alpha").command).to eq("./alpha")
31
+ expect(subject.process("bravo").command).to eq("./bravo")
32
32
  end
33
33
  end
34
34
  end
@@ -56,7 +56,7 @@ describe "Foreman::Engine", :fakefs do
56
56
  it "has the directory default relative to the Procfile" do
57
57
  write_procfile "/some/app/Procfile"
58
58
  engine = Foreman::Engine.new.load_procfile("/some/app/Procfile")
59
- engine.root.should == "/some/app"
59
+ expect(engine.root).to eq("/some/app")
60
60
  end
61
61
  end
62
62
 
@@ -64,7 +64,7 @@ describe "Foreman::Engine", :fakefs do
64
64
  it "should read env files" do
65
65
  File.open("/tmp/env", "w") { |f| f.puts("FOO=baz") }
66
66
  subject.load_env("/tmp/env")
67
- subject.env["FOO"].should == "baz"
67
+ expect(subject.env["FOO"]).to eq("baz")
68
68
  end
69
69
 
70
70
  it "should read more than one if specified" do
@@ -72,8 +72,8 @@ describe "Foreman::Engine", :fakefs do
72
72
  File.open("/tmp/env2", "w") { |f| f.puts("BAZ=qux") }
73
73
  subject.load_env "/tmp/env1"
74
74
  subject.load_env "/tmp/env2"
75
- subject.env["FOO"].should == "bar"
76
- subject.env["BAZ"].should == "qux"
75
+ expect(subject.env["FOO"]).to eq("bar")
76
+ expect(subject.env["BAZ"]).to eq("qux")
77
77
  end
78
78
 
79
79
  it "should handle quoted values" do
@@ -84,10 +84,10 @@ describe "Foreman::Engine", :fakefs do
84
84
  f.puts 'OTHER="escaped\"quote"'
85
85
  end
86
86
  subject.load_env "/tmp/env"
87
- subject.env["FOO"].should == "bar"
88
- subject.env["BAZ"].should == "qux"
89
- subject.env["FRED"].should == "barney"
90
- subject.env["OTHER"].should == 'escaped"quote'
87
+ expect(subject.env["FOO"]).to eq("bar")
88
+ expect(subject.env["BAZ"]).to eq("qux")
89
+ expect(subject.env["FRED"]).to eq("barney")
90
+ expect(subject.env["OTHER"]).to eq('escaped"quote')
91
91
  end
92
92
 
93
93
  it "should handle multiline strings" do
@@ -95,17 +95,17 @@ describe "Foreman::Engine", :fakefs do
95
95
  f.puts 'FOO="bar\nbaz"'
96
96
  end
97
97
  subject.load_env "/tmp/env"
98
- subject.env["FOO"].should == "bar\nbaz"
98
+ expect(subject.env["FOO"]).to eq("bar\nbaz")
99
99
  end
100
100
 
101
101
  it "should fail if specified and doesnt exist" do
102
- lambda { subject.load_env "/tmp/env" }.should raise_error(Errno::ENOENT)
102
+ expect { subject.load_env "/tmp/env" }.to raise_error(Errno::ENOENT)
103
103
  end
104
104
 
105
105
  it "should set port from .env if specified" do
106
106
  File.open("/tmp/env", "w") { |f| f.puts("PORT=9000") }
107
107
  subject.load_env "/tmp/env"
108
- subject.send(:base_port).should == 9000
108
+ expect(subject.send(:base_port)).to eq(9000)
109
109
  end
110
110
  end
111
111
 
@@ -14,6 +14,6 @@ describe "Foreman::Export::Base", :fakefs do
14
14
  end
15
15
 
16
16
  it "raises errors as a Foreman::Export::Exception" do
17
- lambda { subject.send(:error, "foo") }.should raise_error(Foreman::Export::Exception, "foo")
17
+ expect { subject.send(:error, "foo") }.to raise_error(Foreman::Export::Exception, "foo")
18
18
  end
19
19
  end
@@ -15,7 +15,7 @@ describe Foreman::Export::Bluepill, :fakefs do
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  bluepill.export
18
- normalize_space(File.read("/tmp/init/app.pill")).should == normalize_space(example_export_file("bluepill/app.pill"))
18
+ expect(normalize_space(File.read("/tmp/init/app.pill"))).to eq(normalize_space(example_export_file("bluepill/app.pill")))
19
19
  end
20
20
 
21
21
  it "cleans up if exporting into an existing dir" do
@@ -30,7 +30,7 @@ describe Foreman::Export::Bluepill, :fakefs do
30
30
 
31
31
  it "exports to the filesystem with concurrency" do
32
32
  bluepill.export
33
- normalize_space(File.read("/tmp/init/app.pill")).should == normalize_space(example_export_file("bluepill/app-concurrency.pill"))
33
+ expect(normalize_space(File.read("/tmp/init/app.pill"))).to eq(normalize_space(example_export_file("bluepill/app-concurrency.pill")))
34
34
  end
35
35
  end
36
36
 
@@ -16,11 +16,11 @@ describe Foreman::Export::Daemon, :fakefs do
16
16
  it "exports to the filesystem" do
17
17
  daemon.export
18
18
 
19
- File.read("/tmp/init/app.conf").should == example_export_file("daemon/app.conf")
20
- File.read("/tmp/init/app-alpha.conf").should == example_export_file("daemon/app-alpha.conf")
21
- File.read("/tmp/init/app-alpha-1.conf").should == example_export_file("daemon/app-alpha-1.conf")
22
- File.read("/tmp/init/app-bravo.conf").should == example_export_file("daemon/app-bravo.conf")
23
- File.read("/tmp/init/app-bravo-1.conf").should == example_export_file("daemon/app-bravo-1.conf")
19
+ expect(File.read("/tmp/init/app.conf")).to eq(example_export_file("daemon/app.conf"))
20
+ expect(File.read("/tmp/init/app-alpha.conf")).to eq(example_export_file("daemon/app-alpha.conf"))
21
+ expect(File.read("/tmp/init/app-alpha-1.conf")).to eq(example_export_file("daemon/app-alpha-1.conf"))
22
+ expect(File.read("/tmp/init/app-bravo.conf")).to eq(example_export_file("daemon/app-bravo.conf"))
23
+ expect(File.read("/tmp/init/app-bravo-1.conf")).to eq(example_export_file("daemon/app-bravo-1.conf"))
24
24
  end
25
25
 
26
26
  it "cleans up if exporting into an existing dir" do
@@ -56,11 +56,11 @@ describe Foreman::Export::Daemon, :fakefs do
56
56
  it "exports to the filesystem with concurrency" do
57
57
  daemon.export
58
58
 
59
- File.read("/tmp/init/app.conf").should == example_export_file("daemon/app.conf")
60
- File.read("/tmp/init/app-alpha.conf").should == example_export_file("daemon/app-alpha.conf")
61
- File.read("/tmp/init/app-alpha-1.conf").should == example_export_file("daemon/app-alpha-1.conf")
62
- File.read("/tmp/init/app-alpha-2.conf").should == example_export_file("daemon/app-alpha-2.conf")
63
- File.exists?("/tmp/init/app-bravo-1.conf").should == false
59
+ expect(File.read("/tmp/init/app.conf")).to eq(example_export_file("daemon/app.conf"))
60
+ expect(File.read("/tmp/init/app-alpha.conf")).to eq(example_export_file("daemon/app-alpha.conf"))
61
+ expect(File.read("/tmp/init/app-alpha-1.conf")).to eq(example_export_file("daemon/app-alpha-1.conf"))
62
+ expect(File.read("/tmp/init/app-alpha-2.conf")).to eq(example_export_file("daemon/app-alpha-2.conf"))
63
+ expect(File.exists?("/tmp/init/app-bravo-1.conf")).to eq(false)
64
64
  end
65
65
  end
66
66
 
@@ -75,7 +75,7 @@ describe Foreman::Export::Daemon, :fakefs do
75
75
 
76
76
  it "can export with alternate template files" do
77
77
  daemon.export
78
- File.read("/tmp/init/app.conf").should == "alternate_template\n"
78
+ expect(File.read("/tmp/init/app.conf")).to eq("alternate_template\n")
79
79
  end
80
80
  end
81
81
 
@@ -90,7 +90,7 @@ describe Foreman::Export::Daemon, :fakefs do
90
90
 
91
91
  it "can export with alternate template files" do
92
92
  daemon.export
93
- File.read("/tmp/init/app.conf").should == "default_alternate_template\n"
93
+ expect(File.read("/tmp/init/app.conf")).to eq("default_alternate_template\n")
94
94
  end
95
95
  end
96
96