Sha256: 97412cff53dc534d3618c5d658185baec4e28b43120c537a8c9a8ac65e0679c7

Contents?: true

Size: 478 Bytes

Versions: 3

Compression:

Stored size: 478 Bytes

Contents

# RSpec emulation layer.

require 'dfect'

module Dfect
  alias describe D
  alias context  D
  alias it       D

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

    send meth, &block
  end

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

    send meth, &block
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dfect-2.2.0 lib/dfect/spec.rb
dfect-2.1.0 lib/dfect/spec.rb
dfect-2.0.0 lib/dfect/spec.rb