Sign inSign up

mgrafl/shellspec-ext-invocation

By mgrafl

•Updated about 2 years ago

ShellSpec Extension: Invocation

Image
0

1.4K

mgrafl/shellspec-ext-invocation repository overview

A ShellSpec⁠ extension for capturing mock invocations.

⁠Overview

This extension enables bash⁠-based ShellSpec tests to capture mock invocations and to verify expectations about these invocations.

Describe 'capture_invocation in a simple mock'
  It 'captures an invocation and its arguments'
    Mock git
      capture_invocation  git "$@"
    End
    When run  git commit "-m" "Initial commit"
    The number of mocks should equal 1
    The first mock should have received arguments  git commit "-m" "Initial commit"
  End
End

⁠Usage

docker run --rm -t -v ".:/src" mgrafl/shellspec-ext-invocation

⁠Repository

mgrafl/shellspec-ext-invocation⁠ on GitHub.

⁠License

This project is licensed under the MIT license⁠.

Tag summary

Content type

Image

Digest

sha256:3ad2f4709…

Size

98.6 MB

Last updated

about 2 years ago

docker pull mgrafl/shellspec-ext-invocation