Sha256: 01d7f615c8a0ee07b7443521adb1f120099d3cf27d9b7544c7fa7c43602f89e4

Contents?: true

Size: 1.4 KB

Versions: 8

Compression:

Stored size: 1.4 KB

Contents

require 'coveralls'
Coveralls.wear!

require 'minitest/autorun'

# Loads lolcommits directly from the lib folder so don't have to create
# a gem before testing
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'lolcommits'

include Lolcommits
include Methadone::CLILogging

class LolTest < MiniTest::Test
  #
  # issue #53, https://github.com/mroth/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(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'imagesnap', 'imagesnap')).mode & 0o777
    videosnap_perms  = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')).mode & 0o777
    commandcam_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')).mode & 0o777

    assert imagesnap_perms == 0o755 || imagesnap_perms == 0o775,
           "expected perms of 755/775 but instead got #{format '%o', imagesnap_perms}"
    assert videosnap_perms == 0o755 || videosnap_perms == 0o775,
           "expected perms of 755/775 but instead got #{format '%o', videosnap_perms}"
    assert commandcam_perms == 0o755 || commandcam_perms == 0o775,
           "expected perms of 755/775 but instead got #{format '%o', commandcam_perms}"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lolcommits-0.9.8 test/lolcommits_test.rb
lolcommits-0.9.7 test/lolcommits_test.rb
lolcommits-0.9.7.pre1 test/lolcommits_test.rb
lolcommits-0.9.6 test/lolcommits_test.rb
lolcommits-0.9.5 test/lolcommits_test.rb
lolcommits-0.9.5.pre1 test/lolcommits_test.rb
lolcommits-0.9.4 test/lolcommits_test.rb
lolcommits-0.9.4.pre1 test/lolcommits_test.rb