mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

- Load paths with no API when needed (e.g. for `brew edit`) - Use no API mode for `brew log` as it's needed there - Define sharding format for homebrew-cask and homebrew-core inside `Tap` methods - Create new formulae/casks in location defined by these `Tap` methods - Fix a bug in Formulary that made sharded formulae lookup less efficient (and possibly broke it for core and some API usage) - Fix various other hardcoded Formula/Cask directory assumptions Co-authored-by: Bo Anderson <mail@boanderson.me>
23 lines
692 B
Ruby
23 lines
692 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "cmd/shared_examples/args_parse"
|
|
|
|
describe "brew create" do
|
|
let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" }
|
|
let(:formula_file) { CoreTap.new.new_formula_path("testball") }
|
|
|
|
it_behaves_like "parseable arguments"
|
|
|
|
it "creates a new Formula file for a given URL", :integration_test do
|
|
brew "create", "--set-name=Testball", url, "HOMEBREW_EDITOR" => "/bin/cat"
|
|
|
|
expect(formula_file).to exist
|
|
expect(formula_file.read).to match(%Q(sha256 "#{TESTBALL_SHA256}"))
|
|
end
|
|
|
|
it "generates valid cask tokens" do
|
|
t = Cask::Utils.token_from("A Foo@Bar_Baz++!")
|
|
expect(t).to eq("a-foo-at-bar-baz-plus-plus")
|
|
end
|
|
end
|