Module: Fix

Defined in:
lib/fix.rb,
lib/fix/it.rb,
lib/fix/on.rb,
lib/fix/test.rb,
lib/fix/report.rb,
lib/fix/sandbox.rb,
lib/fix/helpers/it_helper.rb,
lib/fix/helpers/on_helper.rb

Overview

Namespace for the Fix framework.

Defined Under Namespace

Modules: ItHelper, OnHelper Classes: It, On, Report, Sandbox, Test

Class Method Summary collapse

Class Method Details

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

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.

Returns:

  • (ExpectationTarget)

    The expectation target.



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)

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