brew/Library/Homebrew/test/dev-cmd/create_spec.rb

29 lines
859 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
2024-03-21 08:08:53 -07:00
require "dev-cmd/create"
2024-03-21 08:08:53 -07:00
RSpec.describe Homebrew::DevCmd::Create do
2017-02-23 06:00:46 +01:00
let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" }
2024-03-06 15:10:14 +01:00
let(:formula_file) { CoreTap.instance.new_formula_path("testball") }
2017-02-23 06:00:46 +01:00
2024-03-21 19:48:13 -07:00
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"
2017-02-23 06:00:46 +01:00
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 FooBar_Baz++!")
expect(t).to eq("a-foobar-baz-plus-plus")
end
it "retains @ in cask tokens" do
t = Cask::Utils.token_from("test@preview")
expect(t).to eq("test@preview")
end
2017-02-23 06:00:46 +01:00
end