bsdcontrol.rb/test/superuser/feature_status_test.rb

27 lines
612 B
Ruby
Raw Permalink Normal View History

2024-05-12 05:59:38 +02:00
# frozen_string_literal: true
2024-03-08 03:41:45 +01:00
require_relative "../setup"
module BSD::Control
2024-05-13 03:32:55 +02:00
class FeatureStatusTest < BSD::Control::Test
def test_pageexec_sysdef_status
2024-10-13 07:05:01 +02:00
assert_equal :sysdef, feature(:pageexec).status(file)
2024-03-08 03:41:45 +01:00
end
def test_pageexec_enabled_status
2024-10-13 07:05:01 +02:00
feature(:pageexec).enable!(file)
assert_equal :enabled, feature(:pageexec).status(file)
2024-03-08 03:41:45 +01:00
end
def test_pageexec_disabled_status
2024-10-13 07:05:01 +02:00
feature(:pageexec).disable!(file)
assert_equal :disabled, feature(:pageexec).status(file)
end
private
def feature(name)
BSD::Control.feature(name)
2024-03-08 03:41:45 +01:00
end
end
end