Class: Assert::Macro
- Inherits:
-
Proc
- Object
- Proc
- Assert::Macro
- Defined in:
- lib/assert/macro.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
this class is essentially a way to define a custom set of tests using arguments.
Instance Method Summary collapse
-
#initialize(name = nil, *args, &block) ⇒ Macro
constructor
A new instance of Macro.
Constructor Details
#initialize(name = nil, *args, &block) ⇒ Macro
Returns a new instance of Macro.
10 11 12 13 14 |
# File 'lib/assert/macro.rb', line 10 def initialize(name=nil, *args, &block) raise ArgumentError unless block_given? @name = name || "run this macro" super() end |
Instance Attribute Details
#name ⇒ Object
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.
8 9 10 |
# File 'lib/assert/macro.rb', line 8 def name @name end |