dyqual

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 3 Imported by: 0

README

dyqual

Gomega Equal with dyff

Usage

import (
    . "github.com/onsi/gomega"
    . "github.com/tenstad/dyqual"
)
Expect(ACTUAL).To(Dyqual(EXPECTED))

Example error message

Comparisons of two Containers from k8s.io/api/core/v1

Dyqual

Dyqual uses dyff to display the changes between EXPECTED and ACTUAL.

  v1.Container not as expected
    
    name
      ± value change
        - ubuntu
        + alpine
    
    ports
      + one list entry added:
        - name: http
          hostport: 0
          containerport: 80
          protocol:
          hostip:
Gomega Equal

Gomega Equal displays all struct fields, regardless of the actual differences.

  Expected
      <v1.Container>: {
          Name: "alpine",
          Image: "",
          Command: nil,
          Args: nil,
          WorkingDir: "",
          Ports: [
              {Name: "http", HostPort: 0, ContainerPort: 80, Protocol: "", HostIP: ""},
          ],
          EnvFrom: nil,
          Env: nil,
          Resources: {Limits: nil, Requests: nil},
          VolumeMounts: nil,
          VolumeDevices: nil,
          LivenessProbe: nil,
          ReadinessProbe: nil,
          StartupProbe: nil,
          Lifecycle: nil,
          TerminationMessagePath: "",
          TerminationMessagePolicy: "",
          ImagePullPolicy: "",
          SecurityContext: nil,
          Stdin: false,
          StdinOnce: false,
          TTY: false,
      }
  to equal
      <v1.Container>: {
          Name: "ubuntu",
          Image: "",
          Command: nil,
          Args: nil,
          WorkingDir: "",
          Ports: nil,
          EnvFrom: nil,
          Env: nil,
          Resources: {Limits: nil, Requests: nil},
          VolumeMounts: nil,
          VolumeDevices: nil,
          LivenessProbe: nil,
          ReadinessProbe: nil,
          StartupProbe: nil,
          Lifecycle: nil,
          TerminationMessagePath: "",
          TerminationMessagePolicy: "",
          ImagePullPolicy: "",
          SecurityContext: nil,
          Stdin: false,
          StdinOnce: false,
          TTY: false,
      }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dyqual

func Dyqual(expected interface{}) types.GomegaMatcher

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL