hgraca/shunit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hgraca/shunit

最新稳定版本:v0.2.0

Composer 安装命令:

composer require hgraca/shunit

包简介

A unit testing framework for shell scripts functions.

README 文档

README

A unit test framework for shell scripts.

How to use

You can install this library in your project, using composer.

Once you have composer installed in your system, you can run composer install, which will install all dependencies and generate the autoloader in vendor/autoload.sh.

For an example, you can check the project Bash Overlay.

Creating and running test suites

Create a test by naming it with the suffix .unit_test.sh, ie my_test.unit_test.sh and put your tests in it while naming the functions with the prefix unit_test.

Ex:

Create this test file and put it in a folder ./tests:

#!/usr/bin/env bash

unit_test.it_should_test_something() {

  if [ "666" == "666" ]; then
    return $0
  fi

  echo "Some error message explaining what failed"
  return $1
}

Execute this test, and all other tests in the folder and sub-folders, by running:

./vendor/bin/shunit ./tests

Bootstrapping your tests

If you want to run some bootstrapping before running your tests, for example to set the logs level, you can do so in the file tests/bootstrap.sh.

Running this project tests

You can run this project test suite by running composer test.

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固