Sha256: 3c70b90030b53ee34f15fedab948443c99c3d1307e0c5b4e53017774d842d3ef

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

# RSpec emulation layer.
#--
# Copyright 2009 Suraj N. Kurapati
# See the LICENSE file for details.
#++

require 'dfect'
require 'delegate'

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.0.0 lib/dfect/spec.rb