Class: Minitest::SelfMonad

Inherits:
ValueMonad show all
Defined in:
lib/minitest/bacon.rb

Constant Summary

Constants inherited from ValueMonad

ValueMonad::VERSION

Instance Method Summary collapse

Methods inherited from ValueMonad

#assert, #be, #be_false, #be_true, #change?, #equal, #flunk, #identical_to, #match, #not, #raise?, #throw?

Constructor Details

#initializeSelfMonad

Returns a new instance of SelfMonad.



105
106
107
108
# File 'lib/minitest/bacon.rb', line 105

def initialize
  super self
  @depth = 0
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object

hacky, saves my butt on StackDepth



110
111
112
113
114
115
# File 'lib/minitest/bacon.rb', line 110

def method_missing(name, *args, &block) # hacky, saves my butt on StackDepth
  @depth += 1
  super unless @depth > 1
ensure
  @depth -= 1
end