Method: Lemon::CoverUnit#initialize
- Defined in:
- lib/lemon/coverage/cover_unit.rb
#initialize(target, method, props = {}) ⇒ CoverUnit
Returns a new instance of CoverUnit.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/lemon/coverage/cover_unit.rb', line 14 def initialize(target, method, props={}) @target = target @method = method.to_sym @covered = props[:covered] @singleton = props[:singleton] ? true : false if @singleton @private = !@target.public_methods.find{ |m| m.to_sym == @method } else @private = !@target.public_instance_methods.find{ |m| m.to_sym == @method } end end |