diff options
| author | Jack Nagel | 2012-05-28 20:43:32 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-05-30 22:32:49 -0500 |
| commit | 7ae740dc95d6692390d5cdaffbb035989ab76608 (patch) | |
| tree | 7dbd79d68a7ac0aefad6d6a4078fb0d4b8e96356 /Library/Homebrew/test | |
| parent | 0dc6ed0677e528755fe7683a8174cf3647fe5d22 (diff) | |
| download | homebrew-7ae740dc95d6692390d5cdaffbb035989ab76608.tar.bz2 | |
cleaner: use new Mach-O pathname methods in clean_file
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_cleaner.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_cleaner.rb b/Library/Homebrew/test/test_cleaner.rb new file mode 100644 index 000000000..e9e9c96ef --- /dev/null +++ b/Library/Homebrew/test/test_cleaner.rb @@ -0,0 +1,38 @@ +require 'testing_env' + +require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser +ARGV.extend(HomebrewArgvExtension) + +require 'cleaner' + +class CleanerTestBall < Formula + def initialize name=nil + @url="file:///#{TEST_FOLDER}/tarballs/testball-0.1.tbz" + @homepage = 'http://example.com/' + super "cleanertestball" + end + + def install + TEST_FOLDER.cd do + bin.mkpath + lib.mkpath + cp 'mach/a.out', bin + cp 'mach/fat.dylib', lib + cp 'mach/x86_64.dylib', lib + cp 'mach/i386.dylib', lib + end + end +end + +class CleanerTests < Test::Unit::TestCase + def test_clean_file + f = CleanerTestBall.new + nostdout { f.brew { f.install } } + + assert_nothing_raised { Cleaner.new f } + assert_equal 0100555, (f.bin/'a.out').stat.mode + assert_equal 0100444, (f.lib/'fat.dylib').stat.mode + assert_equal 0100444, (f.lib/'x86_64.dylib').stat.mode + assert_equal 0100444, (f.lib/'i386.dylib').stat.mode + end +end |
