I am using Test-Kitchen and Serverspec for my integration tests. I want to use a Serverspec file resource to verify whether a hidden file exists, in this case .gemrc
. Here is my spec configuration:
require 'spec_helper'
describe "Checking the .gemrc" do
describe file('~/.gemrc') do
it { should be_file }
end
end
And here is the error output:
Check .gemrc
File "~/.gemrc"
should be file (FAILED - 1)
Failures:
1) Check .gemrc File "~/.gemrc" should be file
Failure/Error: it { should be_file }
test -f \~/.gemrc
expected file? to return true, got false
# /tmp/busser/suites/serverspec/default/ruby_spec.rb:14:in `block (3 levels) in <top (required)>'
Finished in 0.06349 seconds
1 example, 1 failure
Why doesn't the file
resource see the .gemrc file as a normal file?