SVRUnit
  • Welcome
  • Installation
    • Installation
    • First Run
  • Use Cases
    • Verify Server
    • Verify Server for Project
    • Post Deployment Tests
    • Unit Test Docker Image
    • Testing your frameworks
  • Configuration
    • Configuration
  • Commands
    • list:suites
    • list:groups
    • test
  • Assertions
    • Command
    • Directory Exists
    • File Exists
    • File Content
    • File Permissions
    • PHP INI
    • PHP Modules
  • Reports
    • HTML Report
    • JUnit Report
  • Resources
    • svrunit.com
    • Github
Powered by GitBook
On this page
  • Expecting
  • Not Expecting

Was this helpful?

  1. Assertions

File Content

This assertion type helps you to verify if a certain text can be found inside the content of a file.

This is based on a "string contains" check.

Expecting

Use this type to verify that the expected content does exist in the file.

file_content:
    - name: "Verify webservice entry in /etc/hosts"
      file: "/etc/hosts"
      expected: "my-webservice x.x.x.x"

Not Expecting

Use this type to ensure that the content does not exist in the file.

file_content:
    - name: "Verify webservice entry not in /etc/hosts"
      file: "/etc/hosts"
      not_expected: "my-webservice x.x.x.x"
PreviousFile ExistsNextFile Permissions

Last updated 2 years ago

Was this helpful?