Merge pull request #2157 from reitermarkus/spec-create
Convert `brew create` test to spec.
This commit is contained in:
commit
2f28072e78
@ -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
|
||||
13
Library/Homebrew/test/dev-cmd/create_spec.rb
Normal file
13
Library/Homebrew/test/dev-cmd/create_spec.rb
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user