{"id":22688470,"url":"https://github.com/javanile/pipetest","last_synced_at":"2026-04-27T23:35:16.280Z","repository":{"id":89152564,"uuid":"210394956","full_name":"javanile/pipetest","owner":"javanile","description":"⛲ A minimal set of shell functions useful to implement assertions through pipe chaining. Loved by developer","archived":false,"fork":false,"pushed_at":"2024-02-27T09:54:29.000Z","size":66,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T23:56:03.245Z","etag":null,"topics":["assert","assertions","bash","pipe","script","stderr","stdout","testing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javanile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T15:52:15.000Z","updated_at":"2022-11-15T10:11:50.000Z","dependencies_parsed_at":"2024-02-27T10:07:35.882Z","dependency_job_id":"67d4f91f-a04d-4412-966d-f6cf881941ef","html_url":"https://github.com/javanile/pipetest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/javanile/pipetest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fpipetest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fpipetest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fpipetest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fpipetest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javanile","download_url":"https://codeload.github.com/javanile/pipetest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javanile%2Fpipetest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32360113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assert","assertions","bash","pipe","script","stderr","stdout","testing"],"created_at":"2024-12-10T00:14:34.019Z","updated_at":"2026-04-27T23:35:16.265Z","avatar_url":"https://github.com/javanile.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⛲ Pipetest\n\n[![Build Status](https://travis-ci.com/javanile/pipetest.svg?branch=main)](https://travis-ci.com/javanile/pipetest)\n[![License](https://img.shields.io/github/license/shellspec/shellspec.svg)](https://github.com/shellspec/shellspec/blob/master/LICENSE)\n\nPipetest is a [simple and lightweight](#-pipetest \"(but powerful)\") set of shell functions useful\nto implement assertions with [I/O Redirection](https://tldp.org/LDP/abs/html/io-redirection.html).\n\n## Why Pipetest?\n\nThanks to the use of [Piping](https://en.wikipedia.org/wiki/Pipeline_(Unix)) it will be possible to create scripts \nthat are easy to read and able to be understood by a wide audience. \nThis makes Pipetest suitable for the following scenarios\n\n- CI/CD Pipelines\n- Ansible Playbooks\n- Automated Testing\n- Data Processing\n\nIn other words, everything that can refer to this\n\n```bash\n./build-something.sh | assert_equals \"done.\"`\n```\n\n## Suppoerted Shells\n\nWe try to do everything possible to ensure maximum compatibility with these platforms\n\n[![bash](https://img.shields.io/badge/bash-\u0026ge;2.03-lightgrey.svg?style=flat)](https://www.gnu.org/software/bash/)\n[![bosh](https://img.shields.io/badge/bosh-\u0026ge;2018%2F10%2F07-lightgrey.svg?style=flat)](http://schilytools.sourceforge.net/bosh.html)\n[![busybox](https://img.shields.io/badge/busybox-\u0026ge;1.20.0-lightgrey.svg?style=flat)](https://www.busybox.net/)\n[![dash](https://img.shields.io/badge/dash-\u0026ge;0.5.4-lightgrey.svg?style=flat)](http://gondor.apana.org.au/~herbert/dash/)\n[![ksh](https://img.shields.io/badge/ksh-\u0026ge;93s-lightgrey.svg?style=flat)](http://kornshell.org)\n[![mksh](https://img.shields.io/badge/mksh-\u0026ge;R28-lightgrey.svg?style=flat)](http://www.mirbsd.org/mksh.htm)\n[![posh](https://img.shields.io/badge/posh-\u0026ge;0.3.14-lightgrey.svg?style=flat)](https://salsa.debian.org/clint/posh)\n[![yash](https://img.shields.io/badge/yash-\u0026ge;2.29-lightgrey.svg?style=flat)](https://yash.osdn.jp/)\n[![zsh](https://img.shields.io/badge/zsh-\u0026ge;3.1.9-lightgrey.svg?style=flat)](https://www.zsh.org/)\n\n## Get Started\n\nPipetest is just one file, put the file `pipetest.sh` into your project then load as source into your script.\n\n## Installation\n\n```bash\n$ curl -o pipetest.sh https://github.com/javanile/pipetest/releases/download/v0.1.0/pipetest.sh\n```\n\n```bash\n#!/usr/bin/env bash\nset -e\n\nsource pipetest.sh\n\necho \"Hello World!\" | assert_equals \"Hello World!\"\n```\n\n## Documentation \n\nThere are the lists of supported functions\n\n- [**assert_empty**](#assert_empty) - Fails if piped output is not empty\n- [**assert_not_empty**](#assert_not_empty) - Fails if piped output is empty\n- [**assert_equals**](#assert_equals) - Fails if piped output not match with the argument\n- [**assert_not_equals**](#assert_not_equals) - Fails if piped output match with the argument \n- [**assert_starts_with**](#assert_starts_with) - Fails if piped output match with the argument\n- [**assert_each_line_starts_with**](#assert_each_line_starts_with) - Fails if piped output match with the argument\n- [**assert_ends_with**](#assert_ends_with) - Fails if piped output match with the argument\n- [**assert_each_line_ends_with**](#assert_ends_with) - Fails if piped output match with the argument\n- [**assert_match**](#assert_match) - Fails if piped output match with the argument\n- [**assert_file_exists**](#assert_file_exists) - Fails if piped file name as text not exists\n- [**assert_file_not_exists**](#assert_file_not_exists) - Fails if piped file name as text exists\n- [**assert_directory_exists**](#assert_directory_exists) - \n- [**assert_directory_not_exists**](#assert_directory_not_exists)\n\n\u003chr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n### `assert_empty`\n\n\u003c/div\u003e\n\nFails if piped output is not empty.\n\n**Usage**\n\n```bash\n... | assert_empty [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\necho \"\" | assert_empty\n```\n\n```bash \nls | assert_empty \"Current directory is not empty\"\n```\n\n```bash\ncat apache2.log | assert_empty \"Log file is not empty\"\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n### ➡ | `assert_empty`\n\n**Usage**\n\n```bash\n... | assert_empty [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\necho \"\" | assert_empty\n```\n\n```bash\nls | assert_empty\n```\n\n```bash\ncat apache2.log | assert_empty\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n### ➡ | `assert_file_exists`\n\n**Usage**\n\n```bash\nassert_file_exists [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\ntouch sample_file.txt\nassert_file_exists sample_file.txt\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\"\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\" \"Ok! it working.\"\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n### ➡ | `assert_file_exists`\n\n**Usage**\n\n```bash\nassert_file_exists [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\ntouch sample_file.txt\nassert_file_exists sample_file.txt\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\"\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\" \"Ok! it working.\"\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n### ➡ | `assert_file_exists`\n\n**Usage**\n\n```bash\nassert_file_exists [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\ntouch sample_file.txt\nassert_file_exists sample_file.txt\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\"\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\" \"Ok! it working.\"\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n### ➡ | `assert_directory_exists`\n\n**Usage**\n\n```bash\nassert_file_exists [FAIL_MESSAGE] [SUCCESS_MESSAGE]\n```\n\n**Examples**\n\n```bash\ntouch sample_file.txt\nassert_file_exists sample_file.txt\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\"\n```\n\n```bash\nmv old_file_name.txt new_file_name.txt\nassert_file_exists new_file_name.txt \"Moving file goes wrong.\" \"Ok! it working.\"\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#documentation\"\u003e[back to top]\u003c/a\u003e\u003c/div\u003e\n\n\u003chr/\u003e\n\n## Contributing\n\nSee [CONTRIBUTING.md in the repo](https://github.com/javanile/pipetest/blob/main/CONTRIBUTING.md), obviously pull-request are welcome.\n\n## Community \u0026 Questions\n\n- [GitHub Issues](https://github.com/javanile/pipetest/issues): report a bug or raise a feature request to the Pipetest core team\n- [StackOverflow Tag](https://stackoverflow.com/questions/tagged/bash+unit-testing): see existing Q\u0026A for `BASH` and `Unit Testing`. We look at them often\n\n## License\n\nPipetest is open-sourced software licensed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Fpipetest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavanile%2Fpipetest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavanile%2Fpipetest/lists"}