Sha256: 0be6afcb87fd13dde1dd5d6285a5737be3ab9f958c65b6ab2154819e3f20093a

Contents?: true

Size: 436 Bytes

Versions: 9

Compression:

Stored size: 436 Bytes

Contents

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, &block)
      raise ArgumentError unless block_given?
      @name = name || "run this macro"
      super()
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
assert-2.16.5 lib/assert/macro.rb
assert-2.16.4 lib/assert/macro.rb
assert-2.16.3 lib/assert/macro.rb
assert-2.16.2 lib/assert/macro.rb
assert-2.16.1 lib/assert/macro.rb
assert-2.16.0 lib/assert/macro.rb
assert-2.15.2 lib/assert/macro.rb
assert-2.15.1 lib/assert/macro.rb
assert-2.15.0 lib/assert/macro.rb