diff --git a/Formula/crab_share.rb b/Formula/crab_share.rb index c6f5dbd..5253682 100644 --- a/Formula/crab_share.rb +++ b/Formula/crab_share.rb @@ -2,8 +2,8 @@ class CrabShare < Formula desc "Simple application to upload files to an S3 bucket and receive a shareable link" homepage "https://github.com/lounge-rocks/crab_share" - url "https://github.com/lounge-rocks/crab_share/archive/refs/tags/0.3.0.tar.gz" - sha256 "fccdb99d1fed40ea1115dc20bf080f8eff8494ff50890860ada89042b00e2bbf" + url "https://github.com/lounge-rocks/crab_share/archive/refs/tags/0.3.1.tar.gz" + sha256 "359f74a6eddf80df1646ab8c6fba48db9606e4ba939f2b569d5aad413ea1d123" head "https://github.com/lounge-rocks/crab_share.git", branch: "main" @@ -29,5 +29,15 @@ def install # check if help text is printed output = shell_output("#{bin}/crab_share --help") assert_match "Usage:", output + + # upload a test file - expect an error because no credentials are provided + (testpath/"test.txt").write("Hello World!") + output = shell_output("#{bin}/crab_share test.txt 2>&1", 1) + assert_match "Could not read ~/.aws/crab_share.json", output + assert_match "No such file or directory (os error 2)", output + + # upload a test file that does not exist - expect an error + output = shell_output("#{bin}/crab_share file-does-not-exist.txt 2>&1", 1) + assert_match "Path file-does-not-exist.txt does not exist", output end end