Sha256: df670c459669920e61ffd7da27d3bcd0d2cdee92cf8b8f656ea207d68f1c9c73

Contents?: true

Size: 720 Bytes

Versions: 2

Compression:

Stored size: 720 Bytes

Contents

module Fix
  # It's helper.
  #
  # @api private
  #
  module ItHelper
    # Add it method to the DSL.
    #
    # @api public
    #
    # @example It must eql "FOO"
    #   it { MUST Equal: 'FOO' }
    #
    # @param spec [Proc] A spec to compare against the computed actual value.
    #
    # @return [Array] List of results.
    def it(&spec)
      i = It.new(@front_object, @challenges, @helpers.dup)

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

      if @configuration.fetch(:verbose, true)
        print result.to_char(@configuration.fetch(:color, false))
      end

      results << result
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fix-0.11.1 lib/fix/helpers/it_helper.rb
fix-0.11.0 lib/fix/helpers/it_helper.rb