Skip to content

Instantly share code, notes, and snippets.

@sonots
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save sonots/b806e5e6beeedf69570a to your computer and use it in GitHub Desktop.

Select an option

Save sonots/b806e5e6beeedf69570a to your computer and use it in GitHub Desktop.
why-run でテストできない事象はあるのか

結論:みあたらないので誰か

@sonots
Copy link
Author

sonots commented Sep 9, 2014

これはできない。

execute "hack the planet" do
  command "/bin/echo HACKING THE PLANET > foo"
end

が、only_if/not_if をちゃんと書けば、only_if/not_if がテストになるので、why-run でテストできる。

execute "hack the planet" do
  command "/bin/echo HACKING THE PLANET > foo"
  not_if "/usr/bin/test -e foo"
end

ちゃんと中身までチェックするならそういう not_if にしないといけない。

@sonots
Copy link
Author

sonots commented Sep 9, 2014

FileEdit でファイルの内容を置換した場合は、why-run で確認できるのか??

=> これも only_if 次第

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