Sha256: 2ca2281b76939440e24d87a69498160781aa4566c4214e123cd8b8c464eadffc

Contents?: true

Size: 457 Bytes

Versions: 6

Compression:

Stored size: 457 Bytes

Contents

# frozen_string_literal: true

module Assert
  class Macro < ::Proc
    # this class is essentially a way to define a custom set of tests using
    # arguments.  When passed as an argument to the "should" method, a macro
    # will be instance_eval'd in that Assert::Context.
    attr_accessor :name

    def initialize(name = nil, *_args)
      raise ArgumentError unless block_given?
      @name = name || "run this macro"
      super()
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
assert-2.19.8 lib/assert/macro.rb
assert-2.19.7 lib/assert/macro.rb
assert-2.19.6 lib/assert/macro.rb
assert-2.19.5 lib/assert/macro.rb
assert-2.19.4 lib/assert/macro.rb
assert-2.19.3 lib/assert/macro.rb