Merge pull request #2157 from reitermarkus/spec-create

Convert `brew create` test to spec.
This commit is contained in:
Markus Reiter 2017-02-24 17:10:52 +01:00 committed by GitHub
commit 2f28072e78
2 changed files with 13 additions and 12 deletions

View File

@ -1,12 +0,0 @@
require "testing_env"
class IntegrationCommandTestCreate < IntegrationCommandTestCase
def test_create
url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat")
formula_file = CoreTap.new.formula_dir/"testball.rb"
assert formula_file.exist?, "The formula source should have been created"
assert_match %Q(sha256 "#{TESTBALL_SHA256}"), formula_file.read
end
end

View File

@ -0,0 +1,13 @@
describe "brew create", :integration_test do
let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" }
let(:formula_file) { CoreTap.new.formula_dir/"testball.rb" }
it "creates a new Formula file for a given URL" do
shutup do
brew "create", url, "HOMEBREW_EDITOR" => "/bin/cat"
end
expect(formula_file).to exist
expect(formula_file.read).to match(%Q(sha256 "#{TESTBALL_SHA256}"))
end
end