File: runit_spec.rb

package info (click to toggle)
ruby-specinfra 2.94.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: ruby: 10,538; sh: 4; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'spec_helper'

describe Specinfra::Command::Module::Service::Runit do
  class Specinfra::Command::Module::Service::Runit::Test < Specinfra::Command::Base
    extend Specinfra::Command::Module::Service::Runit
  end
  let(:klass) { Specinfra::Command::Module::Service::Runit::Test }
  it { expect(klass.check_is_enabled_under_runit('httpd')).to eq 'test ! -f /etc/sv/httpd/down' }
  it { expect(klass.check_is_running_under_runit('httpd')).to eq "sv status httpd | grep -E '^run: '" }
  it { expect(klass.enable_under_runit('httpd')).to  eq 'ln -s /etc/sv/httpd /var/service/' }
  it { expect(klass.disable_under_runit('httpd')).to eq 'rm /var/service/httpd' }
  it { expect(klass.start_under_runit('httpd')).to   eq 'sv up /var/service/httpd' }
  it { expect(klass.stop_under_runit('httpd')).to    eq 'sv down /var/service/httpd' }
  it { expect(klass.restart_under_runit('httpd')).to eq 'sv restart /var/service/httpd' }
  it { expect(klass.reload_under_runit('httpd')).to  eq 'sv reload /var/service/httpd' }
end