Sha256: 3f0e27b664e2372df1a880300d9c2da9c82346fdc9578d857d8ec7a3b82f1f2e

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require File.expand_path("#{File.dirname(__FILE__)}/test_helper")

class PermissionsTest < Minitest::Test
  #
  # issue #53, https://github.com/lolcommits/lolcommits/issues/53
  # this will test the permissions but only locally, important before building a gem package!
  #
  def test_permissions
    imagesnap_perms  = File.lstat(File.join(Lolcommits::Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'imagesnap', 'imagesnap')).mode & 0o777
    videosnap_perms  = File.lstat(File.join(Lolcommits::Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')).mode & 0o777
    commandcam_perms = File.lstat(File.join(Lolcommits::Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')).mode & 0o777

    assert [0o755, 0o775].include?(imagesnap_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: imagesnap_perms}"
    assert [0o755, 0o775].include?(videosnap_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: videosnap_perms}"
    assert [0o755, 0o775].include?(commandcam_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: commandcam_perms}"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lolcommits-0.17.2 test/permissions_test.rb
lolcommits-0.17.1 test/permissions_test.rb
lolcommits-0.17.0 test/permissions_test.rb
lolcommits-0.16.5 test/permissions_test.rb
lolcommits-0.16.4 test/permissions_test.rb
lolcommits-0.16.3 test/permissions_test.rb