InSpec test fails with Dir.foreach

Do you run the tests locally or remotely? I had a problem with the Dir function running remote tests