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

Add md5checksum #97

Merged
merged 4 commits into from May 10, 2013

Conversation

Projects
None yet
2 participants
@netmarkjp
Copy link
Contributor

netmarkjp commented May 9, 2013

add have_md5checksum matcher for md5 checksum check.

sample use case: check deployment of latest license file with binary format.

netmarkjp added some commits May 9, 2013

@mizzy

This comment has been minimized.

Copy link
Owner

mizzy commented May 9, 2013

Which is better do you think?

  • have_md5checksum
  • match_md5checksum
@netmarkjp

This comment has been minimized.

Copy link
Contributor

netmarkjp commented May 9, 2013

I think match_md5checksum is better.

Shuld I change name and pull-request again?

@mizzy

This comment has been minimized.

Copy link
Owner

mizzy commented May 9, 2013

Thanks for your answer.I think so, too.

You don't need to send a pull request-again.

Only you have to do is change your code and push your code to this branch.

Your change will be added to this pull request automatically.

match do |file|
ret = backend.run_command(backend.commands.check_file_md5checksum(file, pattern))
ret[:exit_status] == 0
end

This comment has been minimized.

@mizzy

mizzy May 10, 2013

Owner
    ret = backend.run_command(backend.commands.check_file_md5checksum(file, pattern))
    ret[:exit_status] == 0

This should be like this:

    backend.check_file_md5checksum(example, file, pattern)

Here, method_missing is called because check_file_md5checksum is not implemented in Backend::Exec.
https://github.com/mizzy/serverspec/blob/master/lib/serverspec/backend/exec.rb#L32

And method_missing runs commands.check_file_md5checksum(file, pattern) and check its exit status.

@mizzy mizzy merged commit b4e20ef into mizzy:master May 10, 2013

1 check passed

default The Travis CI build passed
Details
@mizzy

This comment has been minimized.

Copy link
Owner

mizzy commented May 10, 2013

Thanks!

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