-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcomply.rb
53 lines (48 loc) · 1.51 KB
/
comply.rb
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
48
49
50
51
52
53
class Comply < Formula
desc "Compliance automation framework, focused on SOC2"
homepage "https://comply.strongdm.com"
url "https://github.com/strongdm/comply/archive/v1.6.0.tar.gz"
sha256 "50bfa1d3d0738a324b375e595595ce6de948adf2a6cbee26ebca68e84b308b34"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
ENV.prepend_create_path "PATH", buildpath/"bin"
(buildpath/"src/github.com/strongdm/comply").install buildpath.children
cd "src/github.com/strongdm/comply" do
system "make", "brew"
bin.install "bin/comply"
end
end
test do
(testpath/"init_comply.sh").write <<~EOS
#!/usr/bin/expect -f
set timeout 2
spawn #{bin}/comply init
send -- "Hello Corporation\r"
expect "*Filename Prefix*"
send -- "\r\r\r"
expect "*GitHub*"
send -- "\r"
expect "*Configure github now*"
send -- "\r\r"
expect "+:+"
send -- "thing\r"
expect "+:+"
send -- "thing\r"
expect "+:+"
send -- "thing\r"
expect "+:+"
send -- "thing\r"
expect "*Next steps*"
expect eof
EOS
chmod 0755, testpath/"init_comply.sh"
mkdir testpath/"rundir"
system "cd rundir && ../init_comply.sh"
assert_predicate testpath/"rundir/narratives", :exist?
assert_predicate testpath/"rundir/policies", :exist?
assert_predicate testpath/"rundir/procedures", :exist?
assert_predicate testpath/"rundir/standards", :exist?
assert_predicate testpath/"rundir/templates", :exist?
end
end