Class: Proc

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

Instance Method Summary collapse

Instance Method Details

#change?Boolean

Returns:



190
191
192
193
194
195
# File 'lib/minitest/bacon.rb', line 190

def change?
  before = yield
  call
  after = yield
  before != after
end

#raise?(*exceptions) ⇒ Boolean

Returns:



173
174
175
176
177
178
179
180
# File 'lib/minitest/bacon.rb', line 173

def raise?(*exceptions)
  exceptions = [RuntimeError] if exceptions.empty?
  call
rescue *exceptions => e
  e
else
  false
end

#throw?(sym) ⇒ Boolean

Returns:



182
183
184
185
186
187
188
# File 'lib/minitest/bacon.rb', line 182

def throw?(sym)
  not catch(sym) {
    call
    return false
  }
  return true
end