foreman 0.82.0 → 0.83.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6efd570b3be7d73416c5abf3ea05d1b77a542287
4
- data.tar.gz: 9ffd849979688997a60c50584e8f43cdb5183c09
3
+ metadata.gz: 4b47f2299ea8053d5c06ff2676d7839799a9d0cf
4
+ data.tar.gz: 50e387ed25b8bb71b62ef69107d2d44022dc6f89
5
5
  SHA512:
6
- metadata.gz: 196e4cdae6b750681ffae628c3315dfe256c1014cd60230495c66df36c006cfd5f263c8eebef61c6193d9fc5a977275133d4e2fa5a82c7da3e02c8f8d5a19a76
7
- data.tar.gz: 2af37ab2769f9bde851d2946eaf3950ef9ce37c710bc3734efd6ad9726dbbb1faa96ef885d05a56ec76ec26c0312c234c497ecd590e5be79366ef8fbf4f81583
6
+ metadata.gz: 827d667ac814592eb0b20d719e5997ab716a859a9bcc93f9a3fb62b1ddcd225af7f29650c6ea798a73f472be471fbeca3dd08154a0674f25aa88b2e0694f994a
7
+ data.tar.gz: a4620d3b6937fe56caf2040ff9a7d982fa2e15d20cd85d031a356fb0284a68de78be736b336689dcf8e9cd5b78d2646c64a791d347f28a74f906124c8017ab19
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Foreman
2
2
 
3
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)
4
+ [![Code Climate](https://codeclimate.com/github/ddollar/foreman.svg)](https://codeclimate.com/github/ddollar/foreman)
5
5
  [![Inline docs](http://inch-ci.org/github/ddollar/foreman.svg?branch=master)](http://inch-ci.org/github/ddollar/foreman)
6
6
 
7
7
  Manage Procfile-based applications
@@ -37,6 +37,7 @@ See [.travis.yml](.travis.yml) for a list of Ruby versions against which Foreman
37
37
  * [shoreman](https://github.com/chrismytton/shoreman) - shell
38
38
  * [crank](https://github.com/arktisklada/crank) - Crystal
39
39
  * [houseman](https://github.com/fujimura/houseman) - Haskell
40
+ * [spm](https://github.com/bytegust/spm) - Go
40
41
 
41
42
  ## Authors
42
43
 
@@ -4,13 +4,13 @@ PartOf=<%= app %>-<%= name %>.target
4
4
  [Service]
5
5
  User=<%= user %>
6
6
  WorkingDirectory=<%= engine.root %>
7
- Environment=PORT=%i<% engine.env.each_pair do |var,env| %>
8
- Environment=<%= var.upcase %>=<%= env %><% end %>
7
+ Environment=PORT=%i
8
+ <% if !engine.env.empty? -%>Environment=<% engine.env.each_pair do |var,env| %>"<%= var.upcase %>=<%= env %>" <% end %><% end -%>
9
9
  ExecStart=/bin/bash -lc '<%= process.command %>'
10
10
  Restart=always
11
11
  StandardInput=null
12
12
  StandardOutput=syslog
13
13
  StandardError=syslog
14
14
  SyslogIdentifier=%n
15
- KillMode=process
15
+ KillMode=mixed
16
16
  TimeoutStopSec=<%= engine.options[:timeout] %>
@@ -4,6 +4,7 @@ respawn
4
4
 
5
5
  env PORT=<%= port %>
6
6
  <% engine.env.each do |name,value| -%>
7
+ <% next if name.upcase == "PORT" -%>
7
8
  env <%= name.upcase %>='<%= value.gsub(/'/, "'\"'\"'") %>'
8
9
  <% end -%>
9
10
 
@@ -24,6 +24,7 @@ class Foreman::CLI < Thor
24
24
  method_option :formation, :type => :string, :aliases => "-m", :banner => '"alpha=5,bar=3"', :desc => 'Specify what processes will run and how many. Default: "all=1"'
25
25
  method_option :port, :type => :numeric, :aliases => "-p"
26
26
  method_option :timeout, :type => :numeric, :aliases => "-t", :desc => "Specify the amount of time (in seconds) processes have to shutdown gracefully before receiving a SIGKILL, defaults to 5."
27
+ method_option :timestamp, :type => :boolean, :default => true, :desc => "Include timestamp in output"
27
28
 
28
29
  class << self
29
30
  # Hackery. Take the run method away from Thor so that we can redefine it.
@@ -57,7 +57,8 @@ class Foreman::Engine::CLI < Foreman::Engine
57
57
  data.to_s.lines.map(&:chomp).each do |message|
58
58
  output = ""
59
59
  output += $stdout.color(@colors[name.split(".").first].to_sym)
60
- output += "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | "
60
+ output += "#{Time.now.strftime("%H:%M:%S")} " if options[:timestamp]
61
+ output += "#{pad_process_name(name)} | "
61
62
  output += $stdout.color(:reset)
62
63
  output += message
63
64
  $stdout.puts output
@@ -13,16 +13,19 @@ class Foreman::Export::Upstart < Foreman::Export::Base
13
13
 
14
14
  engine.each_process do |name, process|
15
15
  process_master_file = "#{app}-#{name}.conf"
16
- clean File.join(location, process_master_file)
16
+ process_file = "#{app}-#{name}-%s.conf"
17
+
18
+ Dir[
19
+ File.join(location, process_master_file),
20
+ File.join(location, process_file % "*")
21
+ ].each { |f| clean(f) }
17
22
 
18
23
  next if engine.formation[name] < 1
19
24
  write_template process_master_template, process_master_file, binding
20
25
 
21
26
  1.upto(engine.formation[name]) do |num|
22
27
  port = engine.port_for(process, num)
23
- process_file = "#{app}-#{name}-#{num}.conf"
24
- clean File.join(location, process_file)
25
- write_template process_template, process_file, binding
28
+ write_template process_template, process_file % num, binding
26
29
  end
27
30
  end
28
31
  end
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.82.0"
3
+ VERSION = "0.83.0"
4
4
 
5
5
  end
@@ -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 2016" "Foreman 0.82.0" "Foreman Manual"
4
+ .TH "FOREMAN" "1" "January 2017" "Foreman 0.83.0" "Foreman Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBforeman\fR \- manage Procfile\-based applications
@@ -57,7 +57,7 @@ Specify the amount of time (in seconds) processes have to shutdown gracefully be
57
57
  \fBforeman export\fR is used to export your application to another process management format\.
58
58
  .
59
59
  .P
60
- An location to export can be passed as an argument\. This argument may be either required or optional depending on the export format\.
60
+ A location to export can be passed as an argument\. This argument may be either required or optional depending on the export format\.
61
61
  .
62
62
  .P
63
63
  The following options control how the application is run:
@@ -21,7 +21,7 @@ describe "Foreman::CLI", :fakefs do
21
21
  describe "when a Procfile doesnt exist", :fakefs do
22
22
  it "displays an error" do
23
23
  mock_error(subject, "Procfile does not exist.") do
24
- dont_allow.instance_of(Foreman::Engine).start
24
+ expect_any_instance_of(Foreman::Engine).to_not receive(:start)
25
25
  subject.start
26
26
  end
27
27
  end
@@ -35,19 +35,19 @@ describe "Foreman::Engine", :fakefs do
35
35
 
36
36
  describe "start" do
37
37
  it "forks the processes" do
38
- mock(subject.process("alpha")).run(anything)
39
- mock(subject.process("bravo")).run(anything)
40
- mock(subject).watch_for_output
41
- mock(subject).wait_for_shutdown_or_child_termination
38
+ expect(subject.process("alpha")).to receive(:run)
39
+ expect(subject.process("bravo")).to receive(:run)
40
+ expect(subject).to receive(:watch_for_output)
41
+ expect(subject).to receive(:wait_for_shutdown_or_child_termination)
42
42
  subject.start
43
43
  end
44
44
 
45
45
  it "handles concurrency" do
46
46
  subject.options[:formation] = "alpha=2"
47
- mock(subject.process("alpha")).run(anything).twice
48
- mock(subject.process("bravo")).run(anything).never
49
- mock(subject).watch_for_output
50
- mock(subject).wait_for_shutdown_or_child_termination
47
+ expect(subject.process("alpha")).to receive(:run).twice
48
+ expect(subject.process("bravo")).to_not receive(:run)
49
+ expect(subject).to receive(:watch_for_output)
50
+ expect(subject).to receive(:wait_for_shutdown_or_child_termination)
51
51
  subject.start
52
52
  end
53
53
  end
@@ -9,7 +9,7 @@ describe "Foreman::Export::Base", :fakefs do
9
9
  let(:subject) { Foreman::Export::Base.new(location, engine) }
10
10
 
11
11
  it "has a say method for displaying info" do
12
- mock(subject).puts("[foreman export] foo")
12
+ expect(subject).to receive(:puts).with("[foreman export] foo")
13
13
  subject.send(:say, "foo")
14
14
  end
15
15
 
@@ -11,7 +11,7 @@ describe Foreman::Export::Bluepill, :fakefs do
11
11
  let(:bluepill) { Foreman::Export::Bluepill.new("/tmp/init", engine, options) }
12
12
 
13
13
  before(:each) { load_export_templates_into_fakefs("bluepill") }
14
- before(:each) { stub(bluepill).say }
14
+ before(:each) { allow(bluepill).to receive(:say) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  bluepill.export
@@ -19,7 +19,7 @@ describe Foreman::Export::Bluepill, :fakefs do
19
19
  end
20
20
 
21
21
  it "cleans up if exporting into an existing dir" do
22
- mock(FileUtils).rm("/tmp/init/app.pill")
22
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app.pill")
23
23
 
24
24
  bluepill.export
25
25
  bluepill.export
@@ -11,7 +11,7 @@ describe Foreman::Export::Daemon, :fakefs do
11
11
  let(:daemon) { Foreman::Export::Daemon.new("/tmp/init", engine, options) }
12
12
 
13
13
  before(:each) { load_export_templates_into_fakefs("daemon") }
14
- before(:each) { stub(daemon).say }
14
+ before(:each) { allow(daemon).to receive(:say) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  daemon.export
@@ -24,15 +24,15 @@ describe Foreman::Export::Daemon, :fakefs do
24
24
  end
25
25
 
26
26
  it "cleans up if exporting into an existing dir" do
27
- mock(FileUtils).rm("/tmp/init/app.conf")
28
- mock(FileUtils).rm("/tmp/init/app-alpha.conf")
29
- mock(FileUtils).rm("/tmp/init/app-alpha-1.conf")
30
- mock(FileUtils).rm("/tmp/init/app-bravo.conf")
31
- mock(FileUtils).rm("/tmp/init/app-bravo-1.conf")
32
- mock(FileUtils).rm("/tmp/init/app-foo-bar.conf")
33
- mock(FileUtils).rm("/tmp/init/app-foo-bar-1.conf")
34
- mock(FileUtils).rm("/tmp/init/app-foo_bar.conf")
35
- mock(FileUtils).rm("/tmp/init/app-foo_bar-1.conf")
27
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app.conf")
28
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha.conf")
29
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha-1.conf")
30
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo.conf")
31
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo-1.conf")
32
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar.conf")
33
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar-1.conf")
34
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar.conf")
35
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar-1.conf")
36
36
 
37
37
  daemon.export
38
38
  daemon.export
@@ -44,7 +44,7 @@ describe Foreman::Export::Daemon, :fakefs do
44
44
  ["app2", "app2-alpha", "app2-alpha-1"].each do |name|
45
45
  path = "/tmp/init/#{name}.conf"
46
46
  FileUtils.touch(path)
47
- dont_allow(FileUtils).rm(path)
47
+ expect(FileUtils).to_not receive(:rm).with(path)
48
48
  end
49
49
 
50
50
  daemon.export
@@ -12,7 +12,7 @@ describe Foreman::Export::Inittab, :fakefs do
12
12
  let(:inittab) { Foreman::Export::Inittab.new(location, engine, options) }
13
13
 
14
14
  before(:each) { load_export_templates_into_fakefs("inittab") }
15
- before(:each) { stub(inittab).say }
15
+ before(:each) { allow(inittab).to receive(:say) }
16
16
 
17
17
  it "exports to the filesystem" do
18
18
  inittab.export
@@ -23,7 +23,7 @@ describe Foreman::Export::Inittab, :fakefs do
23
23
  let(:location) { "-" }
24
24
 
25
25
  it "exports to stdout" do
26
- mock(inittab).puts example_export_file("inittab/inittab.default")
26
+ expect(inittab).to receive(:puts).with(example_export_file("inittab/inittab.default"))
27
27
  inittab.export
28
28
  end
29
29
  end
@@ -10,7 +10,7 @@ describe Foreman::Export::Launchd, :fakefs do
10
10
  let(:launchd) { Foreman::Export::Launchd.new("/tmp/init", engine, options) }
11
11
 
12
12
  before(:each) { load_export_templates_into_fakefs("launchd") }
13
- before(:each) { stub(launchd).say }
13
+ before(:each) { allow(launchd).to receive(:say) }
14
14
 
15
15
  it "exports to the filesystem" do
16
16
  launchd.export
@@ -10,8 +10,8 @@ describe Foreman::Export::Runit, :fakefs do
10
10
  let(:runit) { Foreman::Export::Runit.new('/tmp/init', engine, options) }
11
11
 
12
12
  before(:each) { load_export_templates_into_fakefs("runit") }
13
- before(:each) { stub(runit).say }
14
- before(:each) { stub(FakeFS::FileUtils).chmod }
13
+ before(:each) { allow(runit).to receive(:say) }
14
+ before(:each) { allow(FakeFS::FileUtils).to receive(:chmod) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  engine.env["BAR"] = "baz"
@@ -11,7 +11,7 @@ describe Foreman::Export::Supervisord, :fakefs do
11
11
  let(:supervisord) { Foreman::Export::Supervisord.new("/tmp/init", engine, options) }
12
12
 
13
13
  before(:each) { load_export_templates_into_fakefs("supervisord") }
14
- before(:each) { stub(supervisord).say }
14
+ before(:each) { allow(supervisord).to receive(:say) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  write_env(".env", "FOO"=>"bar", "URL"=>"http://example.com/api?foo=bar&baz=1")
@@ -21,7 +21,7 @@ describe Foreman::Export::Supervisord, :fakefs do
21
21
  end
22
22
 
23
23
  it "cleans up if exporting into an existing dir" do
24
- mock(FileUtils).rm("/tmp/init/app.conf")
24
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app.conf")
25
25
  supervisord.export
26
26
  supervisord.export
27
27
  end
@@ -11,7 +11,7 @@ describe Foreman::Export::Systemd, :fakefs do
11
11
  let(:systemd) { Foreman::Export::Systemd.new("/tmp/init", engine, options) }
12
12
 
13
13
  before(:each) { load_export_templates_into_fakefs("systemd") }
14
- before(:each) { stub(systemd).say }
14
+ before(:each) { allow(systemd).to receive(:say) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  systemd.export
@@ -27,27 +27,27 @@ describe Foreman::Export::Systemd, :fakefs do
27
27
  end
28
28
 
29
29
  it "cleans up if exporting into an existing dir" do
30
- mock(FileUtils).rm("/tmp/init/app.target")
30
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app.target")
31
31
 
32
- mock(FileUtils).rm("/tmp/init/app-alpha@.service")
33
- mock(FileUtils).rm("/tmp/init/app-alpha.target")
34
- mock(FileUtils).rm("/tmp/init/app-alpha.target.wants/app-alpha@5000.service")
35
- mock(FileUtils).rm_r("/tmp/init/app-alpha.target.wants")
32
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha@.service")
33
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha.target")
34
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha.target.wants/app-alpha@5000.service")
35
+ expect(FileUtils).to receive(:rm_r).with("/tmp/init/app-alpha.target.wants")
36
36
 
37
- mock(FileUtils).rm("/tmp/init/app-bravo.target")
38
- mock(FileUtils).rm("/tmp/init/app-bravo@.service")
39
- mock(FileUtils).rm("/tmp/init/app-bravo.target.wants/app-bravo@5100.service")
40
- mock(FileUtils).rm_r("/tmp/init/app-bravo.target.wants")
37
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo.target")
38
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo@.service")
39
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo.target.wants/app-bravo@5100.service")
40
+ expect(FileUtils).to receive(:rm_r).with("/tmp/init/app-bravo.target.wants")
41
41
 
42
- mock(FileUtils).rm("/tmp/init/app-foo_bar.target")
43
- mock(FileUtils).rm("/tmp/init/app-foo_bar@.service")
44
- mock(FileUtils).rm("/tmp/init/app-foo_bar.target.wants/app-foo_bar@5200.service")
45
- mock(FileUtils).rm_r("/tmp/init/app-foo_bar.target.wants")
42
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar.target")
43
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar@.service")
44
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar.target.wants/app-foo_bar@5200.service")
45
+ expect(FileUtils).to receive(:rm_r).with("/tmp/init/app-foo_bar.target.wants")
46
46
 
47
- mock(FileUtils).rm("/tmp/init/app-foo-bar.target")
48
- mock(FileUtils).rm("/tmp/init/app-foo-bar@.service")
49
- mock(FileUtils).rm("/tmp/init/app-foo-bar.target.wants/app-foo-bar@5300.service")
50
- mock(FileUtils).rm_r("/tmp/init/app-foo-bar.target.wants")
47
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar.target")
48
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar@.service")
49
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar.target.wants/app-foo-bar@5300.service")
50
+ expect(FileUtils).to receive(:rm_r).with("/tmp/init/app-foo-bar.target.wants")
51
51
 
52
52
 
53
53
  systemd.export
@@ -57,7 +57,7 @@ describe Foreman::Export::Systemd, :fakefs do
57
57
  it "includes environment variables" do
58
58
  engine.env['KEY'] = 'some "value"'
59
59
  systemd.export
60
- expect(File.read("/tmp/init/app-alpha@.service")).to match(/KEY=some "value"$/)
60
+ expect(File.read("/tmp/init/app-alpha@.service")).to match(/KEY=some "value"/)
61
61
  end
62
62
 
63
63
  context "with a formation" do
@@ -11,7 +11,7 @@ describe Foreman::Export::Upstart, :fakefs do
11
11
  let(:upstart) { Foreman::Export::Upstart.new("/tmp/init", engine, options) }
12
12
 
13
13
  before(:each) { load_export_templates_into_fakefs("upstart") }
14
- before(:each) { stub(upstart).say }
14
+ before(:each) { allow(upstart).to receive(:say) }
15
15
 
16
16
  it "exports to the filesystem" do
17
17
  upstart.export
@@ -24,15 +24,15 @@ describe Foreman::Export::Upstart, :fakefs do
24
24
  end
25
25
 
26
26
  it "cleans up if exporting into an existing dir" do
27
- mock(FileUtils).rm("/tmp/init/app.conf")
28
- mock(FileUtils).rm("/tmp/init/app-alpha.conf")
29
- mock(FileUtils).rm("/tmp/init/app-alpha-1.conf")
30
- mock(FileUtils).rm("/tmp/init/app-bravo.conf")
31
- mock(FileUtils).rm("/tmp/init/app-bravo-1.conf")
32
- mock(FileUtils).rm("/tmp/init/app-foo-bar.conf")
33
- mock(FileUtils).rm("/tmp/init/app-foo-bar-1.conf")
34
- mock(FileUtils).rm("/tmp/init/app-foo_bar.conf")
35
- mock(FileUtils).rm("/tmp/init/app-foo_bar-1.conf")
27
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app.conf")
28
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha.conf")
29
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-alpha-1.conf")
30
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo.conf")
31
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-bravo-1.conf")
32
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar.conf")
33
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo-bar-1.conf")
34
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar.conf")
35
+ expect(FileUtils).to receive(:rm).with("/tmp/init/app-foo_bar-1.conf")
36
36
 
37
37
  upstart.export
38
38
  upstart.export
@@ -44,7 +44,7 @@ describe Foreman::Export::Upstart, :fakefs do
44
44
  ["app2", "app2-alpha", "app2-alpha-1"].each do |name|
45
45
  path = "/tmp/init/#{name}.conf"
46
46
  FileUtils.touch(path)
47
- dont_allow(FileUtils).rm(path)
47
+ expect(FileUtils).to_not receive(:rm).with(path)
48
48
  end
49
49
 
50
50
  upstart.export
@@ -56,7 +56,7 @@ describe Foreman::Export::Upstart, :fakefs do
56
56
  ["app-worker", "app-worker-worker", "app-worker-worker-1"].each do |name|
57
57
  path = "/tmp/init/#{name}.conf"
58
58
  FileUtils.touch(path)
59
- dont_allow(FileUtils).rm(path)
59
+ expect(FileUtils).to_not receive(:rm).with(path)
60
60
  end
61
61
 
62
62
  upstart.export
@@ -6,7 +6,7 @@ describe "Foreman::Export" do
6
6
 
7
7
  describe "with a formatter that doesn't declare the appropriate class" do
8
8
  it "prints an error" do
9
- mock(subject).require("foreman/export/invalidformatter")
9
+ expect(subject).to receive(:require).with("foreman/export/invalidformatter")
10
10
  mock_export_error("Unknown export format: invalidformatter (no class Foreman::Export::Invalidformatter).") do
11
11
  subject.formatter("invalidformatter")
12
12
  end
@@ -55,13 +55,13 @@ describe Foreman::Process do
55
55
  end
56
56
 
57
57
  it "can execute" do
58
- mock(Kernel).exec "bin/command"
58
+ expect(Kernel).to receive(:exec).with("bin/command")
59
59
  process = Foreman::Process.new("bin/command")
60
60
  process.exec
61
61
  end
62
62
 
63
63
  it "can execute with env" do
64
- mock(Kernel).exec "bin/command bar"
64
+ expect(Kernel).to receive(:exec).with("bin/command bar")
65
65
  process = Foreman::Process.new("bin/command $FOO")
66
66
  process.exec(:env => { "FOO" => "bar" })
67
67
  end
@@ -5,7 +5,7 @@ describe Foreman do
5
5
 
6
6
  describe "VERSION" do
7
7
  subject { Foreman::VERSION }
8
- it { should be_a String }
8
+ it { is_expected.to be_a String }
9
9
  end
10
10
 
11
11
  describe "runner" do
@@ -11,5 +11,5 @@ StandardInput=null
11
11
  StandardOutput=syslog
12
12
  StandardError=syslog
13
13
  SyslogIdentifier=%n
14
- KillMode=process
14
+ KillMode=mixed
15
15
  TimeoutStopSec=5
@@ -11,5 +11,5 @@ StandardInput=null
11
11
  StandardOutput=syslog
12
12
  StandardError=syslog
13
13
  SyslogIdentifier=%n
14
- KillMode=process
14
+ KillMode=mixed
15
15
  TimeoutStopSec=5
@@ -8,6 +8,7 @@ end
8
8
 
9
9
  require "rspec"
10
10
  require "timecop"
11
+ require "pp"
11
12
  require "fakefs/safe"
12
13
  require "fakefs/spec_helpers"
13
14
 
@@ -19,7 +20,7 @@ end
19
20
 
20
21
  def mock_error(subject, message)
21
22
  mock_exit do
22
- mock(subject).puts("ERROR: #{message}")
23
+ expect(subject).to receive(:puts).with("ERROR: #{message}")
23
24
  yield
24
25
  end
25
26
  end
@@ -166,11 +167,9 @@ ensure
166
167
  end
167
168
 
168
169
  RSpec.configure do |config|
169
- config.treat_symbols_as_metadata_keys_with_true_values = true
170
170
  config.color = true
171
171
  config.order = 'rand'
172
172
  config.include FakeFS::SpecHelpers, :fakefs
173
- config.mock_with :rr
174
173
  config.before(:each) do
175
174
  FileUtils.mkdir_p('/tmp')
176
175
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.82.0
4
+ version: 0.83.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Dollar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-21 00:00:00.000000000 Z
11
+ date: 2017-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor