spec/foreman/cli_spec.rb in foreman-0.63.0-java vs spec/foreman/cli_spec.rb in foreman-0.64.0

- old
+ new

@@ -42,10 +42,17 @@ output.should =~ /echo.1 \| echoing/ output.should =~ /env.1 \| bar/ output.should =~ /test.1 \| testing/ end end + + it "sets PS variable with the process name" do + without_fakefs do + output = foreman("start -f #{resource_path("Procfile")}") + output.should =~ /ps.1 \| PS env var is ps.1/ + end + end end end describe "check" do it "with a valid Procfile displays the jobs" do @@ -90,7 +97,15 @@ it "displays gem version on shortcut command" do foreman("-v").chomp.should == Foreman::VERSION end end + + describe "when posix-spawn is not present on ruby 1.8" do + it "should fail with an error" do + mock(Kernel).require('posix/spawn') { raise LoadError } + output = foreman("start -f #{resource_path("Procfile")}") + output.should == "ERROR: foreman requires gem `posix-spawn` on Ruby #{RUBY_VERSION}. Please `gem install posix-spawn`.\n" + end + end if running_ruby_18? end