lib/specinfra/command/base/file.rb in specinfra-2.0.0.beta29 vs lib/specinfra/command/base/file.rb in specinfra-2.0.0.beta30

- old
+ new

@@ -57,17 +57,15 @@ def check_contains_with_fixed_strings(file, expected_pattern) "grep -qF -- #{escape(expected_pattern)} #{escape(file)}" end - def check_has_md5checksum(file, expected) - regexp = "^#{expected}" - "md5sum #{escape(file)} | grep -iw -- #{escape(regexp)}" + def get_md5sum(file) + "md5sum #{escape(file)} | cut -d ' ' -f 1" end - def check_has_sha256checksum(file, expected) - regexp = "^#{expected}" - "sha256sum #{escape(file)} | grep -iw -- #{escape(regexp)}" + def get_sha256sum(file) + "sha256sum #{escape(file)} | cut -d ' ' -f 1" end def get_content(file) "cat #{file} 2> /dev/null || echo -n" end