Sha256: 8608c54f1b9bb6e5405af3039bb705ec4720e15922334df4b3d823127e0b5690

Contents?: true

Size: 1.18 KB

Versions: 10

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

10 entries across 10 versions & 1 rubygems

Version Path
lolcommits-0.16.2 test/permissions_test.rb
lolcommits-0.16.1 test/permissions_test.rb
lolcommits-0.16.0 test/permissions_test.rb
lolcommits-0.16.0.pre1 test/permissions_test.rb
lolcommits-0.15.1 test/permissions_test.rb
lolcommits-0.15.0 test/permissions_test.rb
lolcommits-0.14.2 test/permissions_test.rb
lolcommits-0.14.1 test/permissions_test.rb
lolcommits-0.14.0 test/permissions_test.rb
lolcommits-0.13.1 test/permissions_test.rb