Sha256: 143b36f6d17a39804a5cfc30691a8f212e997375ce6f2f256d81b28095baf7f3

Contents?: true

Size: 627 Bytes

Versions: 1

Compression:

Stored size: 627 Bytes

Contents

# RSpec emulation layer.
#--
# Copyright protects this work.
# See LICENSE file for details.
#++

require 'dfect'

module Kernel
  def describe *args, &block
    Dfect.D args.join(' '), &block
  end

  alias context describe
  alias it      describe

  def before what, &block
    meth =
      case what
      when :each then :<
      when :all  then :<<
      else raise ArgumentError, what
      end

    Dfect.send meth, &block
  end

  def after what, &block
    meth =
      case what
      when :each then :>
      when :all  then :>>
      else raise ArgumentError, what
      end

    Dfect.send meth, &block
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dfect-1.1.0 lib/dfect/spec.rb