forked from Homebrew/brew
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformula_creator_spec.rb
More file actions
47 lines (44 loc) · 1.42 KB
/
Copy pathformula_creator_spec.rb
File metadata and controls
47 lines (44 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# frozen_string_literal: true
require "formula_creator"
RSpec.describe Homebrew::FormulaCreator do
describe ".new" do
tests = {
"generic tarball URL": {
url: "http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz",
name: "synscan",
version: "5.02",
},
"gitweb URL": {
url: "http://www.codesrc.com/gitweb/index.cgi?p=libzipper.git;a=summary",
name: "libzipper",
},
"GitHub repo URL": {
url: "https://github.com/abitrolly/lapce.git",
name: "lapce",
head: true,
},
"GitHub archive URL": {
url: "https://github.com/abitrolly/lapce/archive/v0.3.0.tar.gz",
name: "lapce",
version: "0.3.0",
},
"GitHub download URL": {
url: "https://github.com/stella-emu/stella/releases/download/6.7/stella-6.7-src.tar.xz",
name: "stella",
version: "6.7",
},
}
tests.each do |description, test|
it "parses #{description}" do
formula_creator = described_class.new(url: test.fetch(:url))
expect(formula_creator.name).to eq(test.fetch(:name))
if (version = test[:version])
expect(formula_creator.version).to eq(version)
else
expect(formula_creator.version).to be_null
end
expect(formula_creator.head).to eq(test.fetch(:head, false))
end
end
end
end