Class: Test::Unit::Context::Shared::Behavior

Inherits:
Module
  • Object
show all
Defined in:
lib/test/unit/context/shared.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block) ⇒ Behavior

Returns a new instance of Behavior.



123
124
125
126
127
# File 'lib/test/unit/context/shared.rb', line 123

def initialize(name, block)
  super()
  @shared_name = name
  @_block = block
end

Instance Attribute Details

#shared_nameObject (readonly)

Returns the value of attribute shared_name.



121
122
123
# File 'lib/test/unit/context/shared.rb', line 121

def shared_name
  @shared_name
end

Instance Method Details

#included(klass) ⇒ Object

:nodoc:



129
130
131
# File 'lib/test/unit/context/shared.rb', line 129

def included(klass) # :nodoc:
  klass.class_eval(&@_block) # @_block.call
end