bsdcontrol.rb/test/superuser/enable_feature_test.rb

28 lines
588 B
Ruby
Raw Normal View History

2024-03-08 00:27:20 +01:00
require_relative "../setup"
module BSD::Control
class EnableFeatureTest < Test::Unit::TestCase
require 'fileutils'
include FileUtils
def test_enable_mprotect
touch(file)
assert BSD::Control.feature!(:mprotect).enable!(file),
"The enable! method should have returned true"
ensure
rm(file)
end
def test_enable_mprotect_nonexistent_file
assert_raises(BSD::Control::Error) do
BSD::Control.feature!(:mprotect).enable!(file)
end
end
private
def file
File.join(__dir__, "file")
end
end
end