lib/specinfra/command/base/file.rb in specinfra-2.0.0.beta31 vs lib/specinfra/command/base/file.rb in specinfra-2.0.0.beta32
- old
+ new
@@ -11,11 +11,11 @@
def check_is_socket(file)
"test -S #{escape(file)}"
end
def check_contains(file, expected_pattern)
- "#{check_file_contains_with_regexp(file, expected_pattern)} || #{check_file_contains_with_fixed_strings(file, expected_pattern)}"
+ "#{check_contains_with_regexp(file, expected_pattern)} || #{check_contains_with_fixed_strings(file, expected_pattern)}"
end
def check_is_grouped(file, group)
regexp = "^#{group}$"
"stat -c %G #{escape(file)} | grep -- #{escape(regexp)}"
@@ -33,11 +33,11 @@
def check_contains_within(file, expected_pattern, from=nil, to=nil)
from ||= '1'
to ||= '$'
sed = "sed -n #{escape(from)},#{escape(to)}p #{escape(file)}"
- checker_with_regexp = check_file_contains_with_regexp("-", expected_pattern)
- checker_with_fixed = check_file_contains_with_fixed_strings("-", expected_pattern)
+ checker_with_regexp = check_contains_with_regexp("-", expected_pattern)
+ checker_with_fixed = check_contains_with_fixed_strings("-", expected_pattern)
"#{sed} | #{checker_with_regexp} || #{sed} | #{checker_with_fixed}"
end
def check_contains_lines(file, expected_lines, from=nil, to=nil)
require 'digest/md5'