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.



119
120
121
122
# File 'lib/minitest/bacon.rb', line 119

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



124
125
126
127
128
129
# File 'lib/minitest/bacon.rb', line 124

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