Module: Fix::ItHelper Private

Defined in:
lib/fix/helpers/it_helper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

It’s helper.

Instance Method Summary collapse

Instance Method Details

#it(&spec) ⇒ Array

Add it method to the DSL.

Examples:

It must eql “FOO”

it { MUST Equal: 'FOO' }

Parameters:

  • spec (Proc)

    A spec to compare against the computed actual value.

Returns:

  • (Array)

    List of results.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fix/helpers/it_helper.rb', line 17

def it(&spec)
  i = It.new do
    Sandbox.new(@front_object, *@challenges).actual
  end

  result = begin
             i.instance_eval(&spec)
           rescue Spectus::Result::Fail => f
             f
           end

  print result.to_char if @configuration.fetch(:verbose, true)
  results << result
end