Module: Fix

Defined in:
lib/fix.rb,
lib/fix/on.rb,
lib/fix/it.rb,
lib/fix/test.rb,
lib/fix/report.rb

Overview

Namespace for the Fix framework.

Defined Under Namespace

Classes: It, On, Report, Test

Class Method Summary collapse

Class Method Details

.describe(front_object, options = {}, &specs) ⇒ Object

Specs are built with this method.

Examples:

42 must be equal to 42

describe(42) do
  it { MUST equal 42 }
end

Parameters:

  • front_object (BasicObject)

    The front object.

  • options (Hash) (defaults to: {})

    Some options.

  • specs (Proc)

    The set of specs.

Raises:

  • (SystemExit)

    The result of the test.



18
19
20
21
22
23
# File 'lib/fix.rb', line 18

def self.describe(front_object, options = {}, &specs)
  t = Test.new(front_object, options, &specs)

  print "#{t.report}" if options.fetch(:verbose, true)
  exit t.pass?
end