lib/serverspec/matchers/be_executable.rb in serverspec-0.4.0 vs lib/serverspec/matchers/be_executable.rb in serverspec-0.4.1

- old
+ new

@@ -1,10 +1,14 @@ RSpec::Matchers.define :be_executable do match do |file| - if @by_user != nil - backend.check_access_by_user(example, file, @by_user, 'x') + if file.respond_to?(:executable?) + file.executable?(@by_whom, @by_user) else - backend.check_executable(example, file, @by_whom) + if @by_user != nil + backend.check_access_by_user(example, file, @by_user, 'x') + else + backend.check_executable(example, file, @by_whom) + end end end chain :by do |by_whom| @by_whom = by_whom end