Sha256: ea0bfadda388e04d1a154e07c8791592521cc26513d5727f0ef5bb0f11ba8d68

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

# Namespace for the Fix framework.
#
# @api public
#
module Fix
  # Specs are built with this method.
  #
  # @example 42 must be equal to 42
  #   describe(42) do
  #     it { MUST equal 42 }
  #   end
  #
  # @param front_object [BasicObject] The front object.
  # @param options      [Hash]        Some options.
  # @param specs        [Proc]        The set of specs.
  #
  # @raise [SystemExit] The result of the test.
  def self.describe(front_object, verbose: true, **options, &specs)
    t = Test.new(front_object, verbose: verbose, **options, &specs)

    print t.report.to_s if verbose
    exit t.pass?
  end
end

require_relative File.join 'fix', 'test'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fix-0.18.1 lib/fix.rb
fix-0.18.0 lib/fix.rb