Module: Fix

Defined in:
lib/fix.rb,
lib/fix/it.rb,
lib/fix/on.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.



20
21
22
23
24
25
# File 'lib/fix.rb', line 20

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

  print t.report.to_s if options.fetch(:verbose, true)
  exit t.pass?
end