diff --git a/lib/vulcano/backend/specinfra.rb b/lib/vulcano/backend/specinfra.rb index c4b9f8c00..2ab65e808 100644 --- a/lib/vulcano/backend/specinfra.rb +++ b/lib/vulcano/backend/specinfra.rb @@ -171,7 +171,7 @@ module Vulcano::Backends path = Shellwords.escape(@path) raw_type = Specinfra::Runner.run_command("stat -c %f #{path}").stdout tmask = raw_type.to_i(16) - res = TYPES.find{|name, mask| mask & tmask} + res = TYPES.find{|name, mask| mask & tmask == mask} return :unknown if res.nil? res[0] end diff --git a/test/docker.rb b/test/docker.rb index 224305f50..df39379a9 100644 --- a/test/docker.rb +++ b/test/docker.rb @@ -2,8 +2,11 @@ require 'docker' require 'yaml' require_relative '../lib/vulcano' -tests = ARGV.drop(1) -exit 0 if tests.empty? +tests = ARGV +if tests.empty? + puts 'Nothing to do.' + exit 0 +end class DockerTester def initialize(tests) diff --git a/test/resource/file.rb b/test/resource/file.rb new file mode 100644 index 000000000..71345c136 --- /dev/null +++ b/test/resource/file.rb @@ -0,0 +1,4 @@ + +describe file('/tmp') do + its(:type) { should eq :directory } +end