File: nopasswd.rb

package info (click to toggle)
ruby-train 3.13.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,208 kB
  • sloc: ruby: 10,002; sh: 17; makefile: 8
file content (12 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
require_relative "run_as"

describe "run_command" do
  it "is running as non-root without sudo" do
    run_as("whoami").stdout.wont_match(/root/i)
  end

  it "is running nopasswd sudo" do
    run_as("whoami", { sudo: true })
      .stdout.must_match(/root/i)
  end
end