Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ztombol/bats-file
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: bats-core/bats-file
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Sep 22, 2018

  1. New file based tests and macOS compatibility (#1)

    * differentiate between files and folders
    
    Add 4 additional asserts to check if a file or a folder exists or not. This could cause that existing tests will fail with `assert_file_exist` or `assert_file_not_exist` if they are testing a folder instead of a file.
    
    * Add more filetype asserts
    
    * assert_block_exist/assert_block_not_exist to test a block special file
    * assert_char_exist/assert_char_not_exist to test a character special file
    * assert_link_exist/assert_link_not_exist to test if a file is a symbolic link
    * assert_socket_exist/assert_socket_not_exist to test if a file is a socket
    * assert_fifo_exist/assert_fifo_not_exist to test if a file is a named pipe
    
    * Added new functions to README
    
    * add tests
    
    * improve macOS compatibility
    
    * adding osx and linux based test
    peshay authored Sep 22, 2018
    Copy the full SHA
    d53e5aa View commit details
  2. Update README.md

    peshay authored Sep 22, 2018
    Copy the full SHA
    633cf2f View commit details

Commits on Sep 24, 2018

  1. Copy the full SHA
    bead629 View commit details
  2. Copy the full SHA
    a3c1cfb View commit details
  3. Resolve review/feedback

    SalimHouari committed Sep 24, 2018
    Copy the full SHA
    8a3282d View commit details
  4. Merge pull request #12 from KingKabyle/New_assert_exec

    New assert_executeable
    peshay authored Sep 24, 2018
    Copy the full SHA
    98a4b0b View commit details

Commits on Oct 22, 2018

  1. Copy the full SHA
    3308542 View commit details

Commits on Nov 12, 2018

  1. assert_equal_files, assert_not_equal_files added to file.bash, README…

    ….… (#15)
    
    * assert_equal_files assert_not_equal_files added to file.bash, README.md and tests
    SalimHouari authored and peshay committed Nov 12, 2018
    Copy the full SHA
    ddc08e1 View commit details

Commits on Nov 13, 2018

  1. Copy the full SHA
    777a9e6 View commit details

Commits on Nov 15, 2018

  1. Copy the full SHA
    6bc8d86 View commit details
  2. Copy the full SHA
    c4c22d7 View commit details
  3. Copy the full SHA
    6f4fc7d View commit details
  4. Copy the full SHA
    9b8f7c7 View commit details
  5. Resolved problem

    SalimHouari committed Nov 15, 2018
    Copy the full SHA
    bbd9080 View commit details
  6. Copy the full SHA
    268f525 View commit details
  7. Copy the full SHA
    f64bad2 View commit details

Commits on Dec 12, 2018

  1. New bats func (#19)

    * Adding assert-file_owner
    
    * Adding assert_not_file_owner
    
    * Adding assert_file_permission and assert_no_file_permission
    
    * Adding assert_zero and assert_not_zero
    
    * Adding assert_file_set_group_id and assert_file_not_set_group_id
    
    * Adding assert_file_set_user_id, assert_file_not_set_user_id, assert_sticky_bit
    
    * Adding Setup and Teardown to every test.
    peshay authored Dec 12, 2018
    Copy the full SHA
    1a4308a View commit details

Commits on Dec 14, 2018

  1. Added assert_file_contains, assert_file_size_equals, assert_file_empt…

    …y,… (#23)
    
    * Add assert_file_contains, assert_file_size_equals, assert_file_empty, assert_file_not_empty
    
    * Modify README.md
    SalimHouari authored and peshay committed Dec 14, 2018
    Copy the full SHA
    c18122f View commit details

Commits on Jan 7, 2019

  1. Enhanced readme.md

    SalimHouari committed Jan 7, 2019
    Copy the full SHA
    ecb78f6 View commit details
  2. Merge pull request #25 from KingKabyle/master

    Enhanced readme.md
    peshay authored Jan 7, 2019
    Copy the full SHA
    c128a1d View commit details

Commits on Feb 14, 2019

  1. Copy the full SHA
    7c966bc View commit details
  2. Merge pull request #26 from KingKabyle/master

    Added link to assert_not_file_permission in README
    peshay authored Feb 14, 2019
    Copy the full SHA
    4b75a1a View commit details

Commits on Apr 29, 2020

  1. Change URLs and repo name

    Changed the URLs and repo names for the repos that have been transferred to bats-core. Updated in docs, travis spec, and install script.
    tralston committed Apr 29, 2020
    Copy the full SHA
    42334df View commit details
  2. Merge pull request #28 from tralston/update-repo-urls-names

    Change URLs and repo name
    sublimino authored Apr 29, 2020
    Copy the full SHA
    17fa557 View commit details

Commits on Mar 4, 2022

  1. Migrate CI to GitHub Actions

    as travis' free tier is discontinued
    martin-schulze-vireso committed Mar 4, 2022
    Copy the full SHA
    0bffdf0 View commit details
  2. Fix failures due to skipped empty files

    the fixture file would not be executed when there are no tests inside
    martin-schulze-vireso committed Mar 4, 2022
    Copy the full SHA
    7771c39 View commit details
  3. Merge pull request #42 from bats-core/feature/migrate_ci_to_github_ac…

    …tions
    
    Migrate CI to GitHub Actions
    martin-schulze-vireso authored Mar 4, 2022
    Copy the full SHA
    1cc81ed View commit details

Commits on Mar 5, 2022

  1. [*] Test case requirements moved into the test cases.

    [*] No ancient back-ticks (see shellcheck for instance)
    [*] No code block duplication
    leventyalcin authored and martin-schulze-vireso committed Mar 5, 2022
    Copy the full SHA
    d7871bb View commit details
  2. Copy the full SHA
    fdd71e8 View commit details
  3. Allow temp functions to also be run setup_file and teardown_file

    Allow temp_make and temp_del to be run in setup_file and teardown_file
    NickLarsenNZ authored and martin-schulze-vireso committed Mar 5, 2022
    Copy the full SHA
    e444dfb View commit details
  4. Copy the full SHA
    06f91d0 View commit details

Commits on Mar 6, 2022

  1. Copy the full SHA
    55c72f2 View commit details
  2. Merge pull request #38 from leventyalcin/fix/assert_file_owner_requir…

    …es_sudo
    
    Fix/assert file owner requires sudo
    martin-schulze-vireso authored Mar 6, 2022
    Copy the full SHA
    bb53897 View commit details
  3. Merge pull request #36 from NickLarsenNZ/patch-1

    Allow temp functions to also be run setup_file and teardown_file
    martin-schulze-vireso authored Mar 6, 2022
    Copy the full SHA
    f01c4b9 View commit details
  4. Do not expand unset variables

    Use '${BATSLIB_FILE_PATH_REM-}' instead of '$BATSLIB_FILE_PATH_REM'.
    
    Use "set -u" in all tests to avoid regressions.
    ms authored and martin-schulze-vireso committed Mar 6, 2022
    Copy the full SHA
    9aefab4 View commit details
  5. Merge pull request #33 from srcbucket/allow-set-u

    Make bats-file safe to use under -u
    martin-schulze-vireso authored Mar 6, 2022
    Copy the full SHA
    e9e8a06 View commit details
  6. Allows temp_del to work when write-protected files or folders are pre…

    …sent in the temporary directory created by temp_make. Added test.
    tralston authored and martin-schulze-vireso committed Mar 6, 2022
    Copy the full SHA
    c9caa1f View commit details
  7. Removed pipe in temp_del() function

    Per comment [here](bats-core/bats-core#276 (comment)) by @Vampire, piped commands aren't necessary when main command has arguments that cover the use case.
    tralston authored and martin-schulze-vireso committed Mar 6, 2022
    Copy the full SHA
    6d1fb88 View commit details
  8. Copy the full SHA
    321fa70 View commit details
  9. CI: Add MacOS

    martin-schulze-vireso committed Mar 6, 2022
    Copy the full SHA
    82d36d1 View commit details
  10. Copy the full SHA
    a40a31f View commit details
  11. Copy the full SHA
    ad052a6 View commit details

Commits on Mar 11, 2022

  1. Copy the full SHA
    4d246eb View commit details
  2. Merge pull request #34 from nkakouros-forks/rename

    Renames assertions for consistency
    martin-schulze-vireso authored Mar 11, 2022
    Copy the full SHA
    89a93e2 View commit details
  3. Copy the full SHA
    4f64ef1 View commit details
  4. Copy the full SHA
    f6fcb7c View commit details
  5. Fixes type in filename

    nkakouros authored and martin-schulze-vireso committed Mar 11, 2022
    Copy the full SHA
    69ca99e View commit details
  6. Merge pull request #43 from nkakouros/rename

    More renames for constistency
    martin-schulze-vireso authored Mar 11, 2022
    Copy the full SHA
    166ed1a View commit details

Commits on Jul 13, 2022

  1. Update README.md

    fixed typo in README
    kim-fehl authored Jul 13, 2022
    Copy the full SHA
    3c84591 View commit details

Commits on Jul 14, 2022

  1. Merge pull request #45 from kim-fehl/patch-1

    Update README.md
    martin-schulze-vireso authored Jul 14, 2022
    Copy the full SHA
    c7df56c View commit details
Showing with 4,446 additions and 147 deletions.
  1. +38 −0 .github/workflows/tests.yml
  2. +3 −0 .gitignore
  3. +0 −8 .travis.yml
  4. +32 −1 CHANGELOG.md
  5. +796 −16 README.md
  6. +36 −0 Vagrantfile
  7. +1 −1 package.json
  8. +2 −2 script/install-bats.sh
  9. +1,036 −13 src/file.bash
  10. +13 −11 src/temp.bash
  11. +70 −0 test/50-assert-10-assert_exists.bats
  12. +0 −56 test/50-assert-11-assert_file_not_exist.bats
  13. +63 −0 test/50-assert-11-assert_not_exists.bats
  14. +22 −15 test/{50-assert-10-assert_file_exist.bats → 51-assert-10-assert_file_exists.bats}
  15. +63 −0 test/51-assert-11-assert_file_not_exists.bats
  16. +65 −0 test/52-assert-10-assert_file_executable.bats
  17. +65 −0 test/52-assert-11-assert_file_not_executable.bats
  18. +66 −0 test/53-assert-10-assert_link_exists.bats
  19. +67 −0 test/53-assert-11-assert_link_not_exists.bats
  20. +63 −0 test/54-assert-10-assert_character_exists.bats
  21. +63 −0 test/54-assert-11-assert_character_not_exists.bats
  22. +62 −0 test/55-assert-10-assert_block_exists.bats
  23. +65 −0 test/55-assert-11-assert_block_not_exists.bats
  24. +63 −0 test/56-assert-10-assert_fifo_exists.bats
  25. +66 −0 test/56-assert-11-assert_fifo_not_exists.bats
  26. +64 −0 test/57-assert-10-assert_socket_exists.bats
  27. +65 −0 test/57-assert-11-assert_socket_not_exists.bats
  28. +91 −0 test/58-assert-10-assert_equal_files.bats
  29. +86 −0 test/58-assert-11-assert_not_equal_files.bats
  30. +81 −0 test/59-assert-10-assert_file_owner.bats
  31. +78 −0 test/59-assert-11-assert_not_file_owner.bats
  32. +74 −0 test/60-assert-10-assert_file_permission.bats
  33. +74 −0 test/60-assert-11-assert_file_no_permissions.bats
  34. +69 −0 test/61-assert-10-size_zero.bats
  35. +67 −0 test/61-assert-11-size_not_zero.bats
  36. +70 −0 test/62-assert-10-assert_file_group_id_set.bats
  37. +67 −0 test/62-assert-11-file_not_group_id_set.bats
  38. +69 −0 test/63-assert-10-assert_file_user_id_set.bats
  39. +68 −0 test/63-assert-11-file_not_user_id_set.bats
  40. +69 −0 test/64-assert-10-assert_sticky_bit.bats
  41. +68 −0 test/64-assert-11-assert_no_sticky_bit.bats
  42. +41 −0 test/65-assert-10-assert_symlink_to.bats
  43. +35 −0 test/65-assert-11-assert_not_symlink_to.bats
  44. +39 −0 test/66-assert-10-assert_file_size_equals.bats
  45. +46 −0 test/67-assert-10-assert_file_contains.bats
  46. +53 −0 test/67-assert-10-assert_file_not_contains.bats
  47. +54 −0 test/68-assert-10-assert_file_empty.bats
  48. +51 −0 test/68-assert-11-assert_file_not_empty.bats
  49. +16 −7 test/{51-temp-10-temp_make.bats → 70-temp-10-temp_make.bats}
  50. +44 −7 test/{51-temp-11-temp_del.bats → 70-temp-11-temp_del.bats}
  51. 0 test/fixtures/{exist/dir/file → empty/dir/empty-file}
  52. +1 −0 test/fixtures/empty/dir/non-empty-file
  53. +4 −0 test/fixtures/exist/dir/.gitignore
  54. +4 −0 test/fixtures/symlink/.gitignore
  55. +4 −0 test/fixtures/temp/temp_del-main.bats
  56. +12 −0 test/fixtures/temp/temp_del-setup_file.bats
  57. +12 −0 test/fixtures/temp/temp_del-teardown_file.bats
  58. +4 −0 test/fixtures/temp/temp_make-main.bats
  59. +15 −0 test/fixtures/temp/temp_make-setup_file.bats
  60. +12 −0 test/fixtures/temp/temp_make-teardown_file.bats
  61. +1 −1 test/fixtures/temp/test_helper.bash
  62. +18 −9 test/test_helper.bash
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck ./src/*
build:
strategy:
matrix:
os: ['macos-15', 'ubuntu-latest']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- run: ./script/install-bats.sh

- uses: actions/checkout@v4
with:
repository: bats-core/bats-support
path: bats-support

# set PATh to ensure we use bats from our local installation (looking at you Mac Runner!)
- name: bats test
run: |
PATH="$HOME/.local/bin:$PATH"
bats -v
BATS_LIB_PATH="$PWD" bats --print-output-on-failure test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vagrant
# vagrant virtualbox image creates this log file. so, better to ignore
*-cloudimg-console.log
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,37 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.4.0] - 2023-08-23

### Added

- add aliases for `assert_*_exist`**s** (#34, #43)
- CI: run shellcheck, fixed found issues (#51)
- `assert_file_contains`: print regex on error (#57)
- add `assert_file_not_contains` (#61)

### Fixed

- various links and typos in README.md (#28, #26, #45)
- migrated CI scripts to Github Actions (#42)
- make `temp_*` functions compatible with `setup_file` (#36)
- don't require `sudo` anymore for `assert_file_owner`/`assert_not_file_owner` (#38, #50)
- fixed internal unset variable errors with `set -u` (#33)
- make `temp_del` work even when contents are write protected (#31)
- parameter documentation for `assert_file_permissions` (#47)
- tests use `bats_load_library bats-support` (#48)
- fix `temp_make` template to work with Alpine's `mktemp` (#52)
- removed `temp.bash`'s executable bit (#55)
- use new `bats_sudo` helper to avoid running `sudo` as root/when not available (#53, 54)
- fix `assert_symlink_to` for temp files in OSX (#56)

## [0.3.0] - 2018-10-28

### Added

- Added assert_files_equal assert_files_not_equal functions!
- Added 2 test scripts for assert_files_equal assert_files_not_equal


## [0.2.0] - 2016-12-07

@@ -24,4 +55,4 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- `npm` support


[0.2.0]: https://github.com/ztombol/bats-file/compare/v0.1.0...v0.2.0
[0.2.0]: https://github.com/bats-core/bats-file/compare/v0.1.0...v0.2.0
Loading