foreman 0.82.0 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/data/export/systemd/process.service.erb +3 -3
- data/data/export/upstart/process.conf.erb +1 -0
- data/lib/foreman/cli.rb +1 -0
- data/lib/foreman/engine/cli.rb +2 -1
- data/lib/foreman/export/upstart.rb +7 -4
- data/lib/foreman/version.rb +1 -1
- data/man/foreman.1 +2 -2
- data/spec/foreman/cli_spec.rb +1 -1
- data/spec/foreman/engine_spec.rb +8 -8
- data/spec/foreman/export/base_spec.rb +1 -1
- data/spec/foreman/export/bluepill_spec.rb +2 -2
- data/spec/foreman/export/daemon_spec.rb +11 -11
- data/spec/foreman/export/inittab_spec.rb +2 -2
- data/spec/foreman/export/launchd_spec.rb +1 -1
- data/spec/foreman/export/runit_spec.rb +2 -2
- data/spec/foreman/export/supervisord_spec.rb +2 -2
- data/spec/foreman/export/systemd_spec.rb +19 -19
- data/spec/foreman/export/upstart_spec.rb +12 -12
- data/spec/foreman/export_spec.rb +1 -1
- data/spec/foreman/process_spec.rb +2 -2
- data/spec/foreman_spec.rb +1 -1
- data/spec/resources/export/systemd/app-alpha@.service +1 -1
- data/spec/resources/export/systemd/app-bravo@.service +1 -1
- data/spec/spec_helper.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b47f2299ea8053d5c06ff2676d7839799a9d0cf
|
4
|
+
data.tar.gz: 50e387ed25b8bb71b62ef69107d2d44022dc6f89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 827d667ac814592eb0b20d719e5997ab716a859a9bcc93f9a3fb62b1ddcd225af7f29650c6ea798a73f472be471fbeca3dd08154a0674f25aa88b2e0694f994a
|
7
|
+
data.tar.gz: a4620d3b6937fe56caf2040ff9a7d982fa2e15d20cd85d031a356fb0284a68de78be736b336689dcf8e9cd5b78d2646c64a791d347f28a74f906124c8017ab19
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Foreman
|
2
2
|
|
3
3
|
[](https://travis-ci.org/ddollar/foreman)
|
4
|
-
[](https://codeclimate.com/github/ddollar/foreman)
|
5
5
|
[](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
|
8
|
-
Environment
|
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=
|
15
|
+
KillMode=mixed
|
16
16
|
TimeoutStopSec=<%= engine.options[:timeout] %>
|
data/lib/foreman/cli.rb
CHANGED
@@ -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.
|
data/lib/foreman/engine/cli.rb
CHANGED
@@ -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")}
|
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
|
-
|
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
|
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
|
data/lib/foreman/version.rb
CHANGED
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" "
|
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
|
-
|
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:
|
data/spec/foreman/cli_spec.rb
CHANGED
@@ -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
|
-
|
24
|
+
expect_any_instance_of(Foreman::Engine).to_not receive(:start)
|
25
25
|
subject.start
|
26
26
|
end
|
27
27
|
end
|
data/spec/foreman/engine_spec.rb
CHANGED
@@ -35,19 +35,19 @@ describe "Foreman::Engine", :fakefs do
|
|
35
35
|
|
36
36
|
describe "start" do
|
37
37
|
it "forks the processes" do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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
|
-
|
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) {
|
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
|
-
|
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) {
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
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) {
|
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
|
-
|
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) {
|
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) {
|
14
|
-
before(:each) {
|
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) {
|
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
|
-
|
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) {
|
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
|
-
|
30
|
+
expect(FileUtils).to receive(:rm).with("/tmp/init/app.target")
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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) {
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
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
|
-
|
59
|
+
expect(FileUtils).to_not receive(:rm).with(path)
|
60
60
|
end
|
61
61
|
|
62
62
|
upstart.export
|
data/spec/foreman/export_spec.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
data/spec/foreman_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -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
|
-
|
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.
|
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:
|
11
|
+
date: 2017-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|