tests: remove unnecessary code
This commit is contained in:
parent
abf75cd08f
commit
6cccc2d0fe
@ -267,13 +267,12 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_desc
|
def test_desc
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
desc "Some test"
|
desc "Some test"
|
||||||
url "https://example.com/testball-0.1.tar.gz"
|
url "https://example.com/testball-0.1.tar.gz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
assert_equal "testball: Some test", cmd("desc", "testball")
|
assert_equal "testball: Some test", cmd("desc", "testball")
|
||||||
ensure
|
ensure
|
||||||
@ -283,13 +282,12 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
def test_edit
|
def test_edit
|
||||||
(HOMEBREW_REPOSITORY/".git").mkpath
|
(HOMEBREW_REPOSITORY/".git").mkpath
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "https://example.com/testball-0.1.tar.gz"
|
url "https://example.com/testball-0.1.tar.gz"
|
||||||
# something here
|
# something here
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
assert_match "# something here",
|
assert_match "# something here",
|
||||||
cmd("edit", "testball", {"HOMEBREW_EDITOR" => "/bin/cat"})
|
cmd("edit", "testball", {"HOMEBREW_EDITOR" => "/bin/cat"})
|
||||||
@ -305,12 +303,11 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_info
|
def test_info
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "https://example.com/testball-0.1.tar.gz"
|
url "https://example.com/testball-0.1.tar.gz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
assert_match "testball: stable 0.1",
|
assert_match "testball: stable 0.1",
|
||||||
cmd("info", "testball")
|
cmd("info", "testball")
|
||||||
@ -330,12 +327,11 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_unpack
|
def test_unpack
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
mktmpdir do |path|
|
mktmpdir do |path|
|
||||||
cmd "unpack", "testball", "--destdir=#{path}"
|
cmd "unpack", "testball", "--destdir=#{path}"
|
||||||
@ -349,14 +345,13 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_options
|
def test_options
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
option "with-foo", "foobar"
|
option "with-foo", "foobar"
|
||||||
depends_on "bar" => :recommended
|
depends_on "bar" => :recommended
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
assert_equal "--with-foo\n\tfoobar\n--without-bar\n\tBuild without bar support",
|
assert_equal "--with-foo\n\tfoobar\n--without-bar\n\tBuild without bar support",
|
||||||
cmd_output("options", "testball").chomp
|
cmd_output("options", "testball").chomp
|
||||||
@ -366,13 +361,11 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_outdated
|
def test_outdated
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
||||||
|
|
||||||
assert_equal "testball", cmd("outdated")
|
assert_equal "testball", cmd("outdated")
|
||||||
@ -383,7 +376,7 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_upgrade
|
def test_upgrade
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
sha256 "#{TESTBALL_SHA256}"
|
sha256 "#{TESTBALL_SHA256}"
|
||||||
@ -393,7 +386,6 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
||||||
|
|
||||||
@ -412,12 +404,11 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
apps_dir.mkpath
|
apps_dir.mkpath
|
||||||
|
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "https://example.com/testball-0.1.tar.gz"
|
url "https://example.com/testball-0.1.tar.gz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
source_dir = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
|
source_dir = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
|
||||||
source_dir.mkpath
|
source_dir.mkpath
|
||||||
@ -435,12 +426,11 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
apps_dir.mkpath
|
apps_dir.mkpath
|
||||||
|
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "https://example.com/testball-0.1.tar.gz"
|
url "https://example.com/testball-0.1.tar.gz"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
source_app = (HOMEBREW_CELLAR/"testball/0.1/TestBall.app")
|
source_app = (HOMEBREW_CELLAR/"testball/0.1/TestBall.app")
|
||||||
source_app.mkpath
|
source_app.mkpath
|
||||||
@ -457,7 +447,7 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_pin_unpin
|
def test_pin_unpin
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
sha256 "#{TESTBALL_SHA256}"
|
sha256 "#{TESTBALL_SHA256}"
|
||||||
@ -467,8 +457,6 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
|
||||||
|
|
||||||
cmd("pin", "testball")
|
cmd("pin", "testball")
|
||||||
@ -488,7 +476,7 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_reinstall
|
def test_reinstall
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
sha256 "#{TESTBALL_SHA256}"
|
sha256 "#{TESTBALL_SHA256}"
|
||||||
@ -501,7 +489,6 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
cmd("install", "testball", "--with-foo")
|
cmd("install", "testball", "--with-foo")
|
||||||
foo_dir = HOMEBREW_CELLAR/"testball/0.1/foo"
|
foo_dir = HOMEBREW_CELLAR/"testball/0.1/foo"
|
||||||
@ -549,13 +536,12 @@ class IntegrationCommandTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_fetch
|
def test_fetch
|
||||||
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
formula_file = CoreFormulaRepository.new.formula_dir/"testball.rb"
|
||||||
content = <<-EOS.undent
|
formula_file.write <<-EOS.undent
|
||||||
class Testball < Formula
|
class Testball < Formula
|
||||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||||
sha256 "#{TESTBALL_SHA256}"
|
sha256 "#{TESTBALL_SHA256}"
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
formula_file.write content
|
|
||||||
|
|
||||||
cmd("fetch", "testball")
|
cmd("fetch", "testball")
|
||||||
assert (HOMEBREW_CACHE/"testball-0.1.tbz").exist?,
|
assert (HOMEBREW_CACHE/"testball-0.1.tbz").exist?,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user