Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix get_file_content method #16

Merged
merged 2 commits into from Dec 11, 2013
Merged

fix get_file_content method #16

merged 2 commits into from Dec 11, 2013

Conversation

@presto53
Copy link
Contributor

@presto53 presto53 commented Dec 9, 2013

Example:
describe file('/usr/local/etc/nginx/upstreams.conf') do
it { should be_file }
its(:content) { should match /upstream/ }
end
match in this example will be false positive, because of stderr that include file name.
I think in case if we don't have file for this matcher we should return error or empty string.
With this fix it will return empty string.

@mizzy
Copy link
Owner

@mizzy mizzy commented Dec 10, 2013

cat #{file} 2> || echo -n shows error in my environment.(Scientific Linux and Mac OS)

How about cat #{file} 2> /dev/null || echo -n ?

@presto53
Copy link
Contributor Author

@presto53 presto53 commented Dec 10, 2013

You right, this is my fault, sorry. Now should be fine.

mizzy added a commit that referenced this issue Dec 11, 2013
@mizzy mizzy merged commit c5a01dc into mizzy:master Dec 11, 2013
1 check passed
@mizzy
Copy link
Owner

@mizzy mizzy commented Dec 11, 2013

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants