From 8ed666ae7d0e272a9415b94d397aa0574965f9ef Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 20 Jun 2012 00:51:01 -0500 Subject: tests: clean up whitespace Signed-off-by: Jack Nagel --- Library/Homebrew/test/test_ARGV.rb | 4 +-- Library/Homebrew/test/test_ENV.rb | 2 +- Library/Homebrew/test/test_bucket.rb | 24 ++++++++-------- Library/Homebrew/test/test_checksums.rb | 18 ++++++------ Library/Homebrew/test/test_formula.rb | 8 +++--- Library/Homebrew/test/test_formula_install.rb | 20 +++++++------- Library/Homebrew/test/test_hardware.rb | 2 +- Library/Homebrew/test/test_inreplace.rb | 6 ++-- Library/Homebrew/test/test_mach.rb | 10 ------- Library/Homebrew/test/test_patches.rb | 8 +++--- Library/Homebrew/test/test_patching.rb | 10 +++---- Library/Homebrew/test/test_pathname_install.rb | 38 +++++++++++++------------- Library/Homebrew/test/test_string.rb | 2 +- Library/Homebrew/test/test_updater.rb | 2 +- Library/Homebrew/test/test_versions.rb | 4 +-- Library/Homebrew/test/testball.rb | 4 +-- 16 files changed, 76 insertions(+), 86 deletions(-) diff --git a/Library/Homebrew/test/test_ARGV.rb b/Library/Homebrew/test/test_ARGV.rb index 1e65fe143..219049365 100644 --- a/Library/Homebrew/test/test_ARGV.rb +++ b/Library/Homebrew/test/test_ARGV.rb @@ -20,9 +20,9 @@ class ARGVTests < Test::Unit::TestCase def test_ARGV assert ARGV.named.empty? - + (HOMEBREW_CELLAR+'mxcl/10.0').mkpath - + ARGV.reset ARGV.unshift 'mxcl' assert_equal 1, ARGV.named.length diff --git a/Library/Homebrew/test/test_ENV.rb b/Library/Homebrew/test/test_ENV.rb index 210b5d4c5..cd9c930ed 100644 --- a/Library/Homebrew/test/test_ENV.rb +++ b/Library/Homebrew/test/test_ENV.rb @@ -1,6 +1,6 @@ require 'testing_env' require 'hardware' - + class EnvironmentTests < Test::Unit::TestCase def test_ENV_options ENV.gcc_4_0 diff --git a/Library/Homebrew/test/test_bucket.rb b/Library/Homebrew/test/test_bucket.rb index cdbe9bd81..ace2c1096 100644 --- a/Library/Homebrew/test/test_bucket.rb +++ b/Library/Homebrew/test/test_bucket.rb @@ -1,7 +1,7 @@ require 'testing_env' require 'test/testball' -class MockFormula "http://example.com/patch.diff" }) assert_equal 1, patches.patches.length - + p = patches.patches[0] assert_equal :p0, p.patch_p end @@ -47,7 +47,7 @@ class PatchingTests < Test::Unit::TestCase :p1 => "http://example.com/patch.diff" }) assert_equal 1, patches.patches.length - + p = patches.patches[0] assert_equal :p1, p.patch_p end diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/test_patching.rb index 248530a49..e0064864e 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/test/test_patching.rb @@ -2,26 +2,26 @@ require 'testing_env' require 'test/testball' -class DefaultPatchBall ["file:///#{TEST_FOLDER}/patches/noop-b.diff"] } end end -class P1PatchBall ["file:///#{TEST_FOLDER}/patches/noop-a.diff"] } end @@ -32,7 +32,7 @@ class PatchingTests < Test::Unit::TestCase def read_file path File.open(path, 'r') { |f| f.read } end - + def test_single_patch shutup do DefaultPatchBall.new('test_patch').brew do diff --git a/Library/Homebrew/test/test_pathname_install.rb b/Library/Homebrew/test/test_pathname_install.rb index bdd90ec4c..68dbccd16 100644 --- a/Library/Homebrew/test/test_pathname_install.rb +++ b/Library/Homebrew/test/test_pathname_install.rb @@ -7,7 +7,7 @@ class PathnameInstallTests < Test::Unit::TestCase def setup FileUtils.mkdir_p TEMP_FOLDER end - + def with_temp_folder TEMP_FOLDER.cd do # Keep these around while building out tests, to make sure @@ -19,47 +19,47 @@ class PathnameInstallTests < Test::Unit::TestCase yield end end - + def test_install_missing_file assert_raises(RuntimeError) do Pathname.getwd.install 'non_existant_file' end end - + def test_install with_temp_folder do TARGET_FOLDER.install 'a.txt' - + assert (TARGET_FOLDER+'a.txt').exist?, "a.txt not installed." assert !(TARGET_FOLDER+'b.txt').exist?, "b.txt was installed." end end - + def test_install_list with_temp_folder do TARGET_FOLDER.install %w[a.txt b.txt] - + assert (TARGET_FOLDER+'a.txt').exist?, "a.txt not installed." assert (TARGET_FOLDER+'b.txt').exist?, "b.txt not installed." end end - + def test_install_glob with_temp_folder do TARGET_FOLDER.install Dir['*.txt'] - + assert (TARGET_FOLDER+'a.txt').exist?, "a.txt not installed." assert (TARGET_FOLDER+'b.txt').exist?, "b.txt not installed." end end - + def test_install_folder with_temp_folder do FileUtils.mkdir_p "bin" system "mv *.txt bin" - + TARGET_FOLDER.install "bin" - + assert (TARGET_FOLDER+'bin/a.txt').exist?, "a.txt not installed." assert (TARGET_FOLDER+'bin/b.txt').exist?, "b.txt not installed." end @@ -68,40 +68,40 @@ class PathnameInstallTests < Test::Unit::TestCase def test_install_rename with_temp_folder do TARGET_FOLDER.install 'a.txt' => 'c.txt' - + assert (TARGET_FOLDER+'c.txt').exist?, "c.txt not installed." assert !(TARGET_FOLDER+'a.txt').exist?, "a.txt was installed but not renamed." assert !(TARGET_FOLDER+'b.txt').exist?, "b.txt was installed." end end - + def test_install_rename_more with_temp_folder do TARGET_FOLDER.install({'a.txt' => 'c.txt', 'b.txt' => 'd.txt'}) - + assert (TARGET_FOLDER+'c.txt').exist?, "c.txt not installed." assert (TARGET_FOLDER+'d.txt').exist?, "d.txt not installed." assert !(TARGET_FOLDER+'a.txt').exist?, "a.txt was installed but not renamed." assert !(TARGET_FOLDER+'b.txt').exist?, "b.txt was installed but not renamed." end end - + def test_install_rename_folder with_temp_folder do FileUtils.mkdir_p "bin" system "mv *.txt bin" - + TARGET_FOLDER.install "bin" => "libexec" - + assert !(TARGET_FOLDER+'bin').exist?, "bin was installed but not renamed." assert (TARGET_FOLDER+'libexec/a.txt').exist?, "a.txt not installed." assert (TARGET_FOLDER+'libexec/b.txt').exist?, "b.txt not installed." end end - + # test_install_symlink # test_install_relative_symlink - + def teardown FileUtils.rm_rf TEMP_FOLDER end diff --git a/Library/Homebrew/test/test_string.rb b/Library/Homebrew/test/test_string.rb index 2acc21ddb..6f8692367 100644 --- a/Library/Homebrew/test/test_string.rb +++ b/Library/Homebrew/test/test_string.rb @@ -1,7 +1,7 @@ require 'testing_env' require 'extend/string' -class StringTest