Skip to content

Conditional assertions for more fine-grained logic #35

@tomas-fp

Description

@tomas-fp

New API method:

  • grappa.when
if grappa.when(should.be.os('centos')):
    'nginx' | should.be.running
    80 | should.be.listening
    'eth0' | should.have.interface

if not grappa.when(should.be.os('ubuntu')):
    'apache' | should.be.running
    8080 | should.be.listening

if '/opt' | grappa.when(should.path.exists):
    '/opt/foo' | should.directory.exists
    '/opt' | should.have.subdirectories(['log', 'app', 'run'])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions