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

Conversation

Projects
None yet
2 participants
@presto53
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 10, 2013

Owner

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

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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@presto53

presto53 Dec 10, 2013

Contributor

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

Contributor

presto53 commented Dec 10, 2013

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

mizzy added a commit that referenced this pull request Dec 11, 2013

@mizzy mizzy merged commit c5a01dc into mizzy:master Dec 11, 2013

1 check passed

default The Travis CI build passed
Details
@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 11, 2013

Owner

Thanks!

Owner

mizzy commented Dec 11, 2013

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment