2014-02-05 22:42:36 +08:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
describe Cask::CLI::Cleanup do
|
|
|
|
it 'does nothing with --outdated in the clean test environment' do
|
|
|
|
Cask.outdated = true
|
|
|
|
out, err = capture_io do
|
|
|
|
Cask::CLI::Cleanup.run
|
|
|
|
end
|
|
|
|
out.must_equal <<-OUTPUT.undent
|
|
|
|
==> Removing dead symlinks
|
2014-06-19 19:24:10 +08:00
|
|
|
Nothing to do
|
2014-02-05 22:42:36 +08:00
|
|
|
==> Removing cached downloads older than 10 days old
|
2014-06-19 19:24:10 +08:00
|
|
|
Nothing to do
|
2014-02-05 22:42:36 +08:00
|
|
|
OUTPUT
|
|
|
|
end
|
|
|
|
|
|
|
|
# note: this test will fail in isolation. It depends on other
|
|
|
|
# portions of the test suite leaving some files to do cleanup.
|
|
|
|
it 'cleans up new files in the test environment' do
|
|
|
|
Cask.outdated = false
|
|
|
|
out, err = capture_io do
|
|
|
|
Cask::CLI::Cleanup.run
|
|
|
|
end
|
2014-06-19 19:24:10 +08:00
|
|
|
out.must_match(/^==> Removing dead symlinks\nNothing to do\n==> Removing cached downloads\n/)
|
2014-02-05 22:42:36 +08:00
|
|
|
end
|
|
|
|
end
|