什么时候为文件资源类型添加md5sum属性? Serverspec 的版本报告 md5sum 未找到。
describe file ('/etc/sysctl.conf' ) do
it { should be_file }
its(:md5sum) { should eq '07a47f3db13458ebc93b334973cc8720' }
its(:sha256sum) { should eq 'd63896fa456d47dde634c592d46d1d39cb6183fdbc450a2581b6f12d977ee2d1' }
it { should be_mode 644 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end
Failure/Error: its(:md5sum) { should eq '07a47f3db13458ebc93b334973cc8720' }
NoMethodError: undefined method `md5sum' for File "/etc/sysctl.conf":Serverspec::Type::File
apt-cache show ruby-serverspec
Package: ruby-serverspec
Version: 1.14.0-2
最佳答案
It was added on August 10, 2014 .它显然是在 2014 年 10 月 8 日随版本 2.0.0 一起发布的。
关于ruby - 无方法错误 : undefined method `md5sum' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27450845/