Exception: Exception

Defined in:
lib/assay/ae/core_ext.rb

Direct Known Subclasses

Assertion

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.raised? ⇒ Boolean

Does the block raise this exception, or a kind of it?

Returns:

  • (Boolean)


130
131
132
133
134
135
# File 'lib/assay/ae/core_ext.rb', line 130

def self.raised? #:yield:
  yield
  false
rescue self
  true
end

Instance Method Details

#negative? ⇒ Boolean

Was the assertion that raised this exception a negated one?

Returns:

  • (Boolean)


138
139
140
# File 'lib/assay/ae/core_ext.rb', line 138

def negative?
  @negative || false
end

#set_negative(boolean) ⇒ Object

Set whether the exception came from a negated assertion.



143
144
145
# File 'lib/assay/ae/core_ext.rb', line 143

def set_negative(boolean)
  @negative = !!boolean
end