-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfauna-shell.rb
32 lines (25 loc) · 1.06 KB
/
fauna-shell.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
require "language/node"
class FaunaShell < Formula
desc "Interactive shell for FaunaDB"
homepage "https://fauna.com/"
url "https://registry.npmjs.org/fauna-shell/-/fauna-shell-0.5.0.tgz"
sha256 "b365080e638d85104a9ae533c6271c2dae692a5d6cc09f7fdb15d5c8870a96aa"
bottle do
cellar :any_skip_relocation
sha256 "38aa9051550b380601f151595a0bf5cfe5b379bcc2ca698185f42c8203941839" => :high_sierra
sha256 "11f3fcdf64f00f374af9a3dc2812fc1d99178c12146a9d8bc496496be1ab4190" => :sierra
sha256 "44b0dc90d6d6ffaee55ebe7dd569d540f388ffaa5c15a87e1991a355d58ddc81" => :el_capitan
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
output = shell_output("#{bin}/fauna list-endpoints 2>&1", 1)
assert_match "No endpoints defined", output
pipe_output("#{bin}/fauna add-endpoint https://endpoint1:8443", "secret\nendpoint1\n")
output = shell_output("#{bin}/fauna list-endpoints")
assert_equal "endpoint1 *\n", output
end
end