Sha256: 85e3ec11d1d18f20685d5180317b9ad0caf3d213a47acf96f542e1bb83a8a76d

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

#############################################################################
# test_win32_file_security_ffi.rb
#
# Tests to ensure that the FFI functions are private
#############################################################################
require 'test-unit'
require 'win32/file/security'

class TC_Win32_File_Security_FFI < Test::Unit::TestCase
  def setup
    @singleton_methods = File.methods.map{ |m| m.to_s }
    @instance_methods  = File.instance_methods.map{ |m| m.to_s }
  end

  test "internal ffi functions are not public as singleton methods" do
    assert_false(@singleton_methods.include?('AddAce'))
    assert_false(@singleton_methods.include?('CloseHandle'))
    assert_false(@singleton_methods.include?('GetFileSecurityW'))
    assert_false(@singleton_methods.include?('PathIsRootW'))
  end

  test "internal ffi functions are not public as instance methods" do
    assert_false(@instance_methods.include?('AddAce'))
    assert_false(@instance_methods.include?('CloseHandle'))
    assert_false(@instance_methods.include?('GetFileSecurityW'))
    assert_false(@instance_methods.include?('PathIsRootW'))
  end

  def teardown
    @singleton_methods = nil
    @instance_methods = nil
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ffi.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/win32-file-security-1.0.10/test/test_win32_file_security_ffi.rb
win32-file-security-1.0.10 test/test_win32_file_security_ffi.rb
win32-file-security-1.0.9 test/test_win32_file_security_ffi.rb
win32-file-security-1.0.8 test/test_win32_file_security_ffi.rb
win32-file-security-1.0.7 test/test_win32_file_security_ffi.rb