Module: RLab::Assert
- Defined in:
- lib/rlab/assert.rb,
lib/rlab/assert/check.rb,
lib/rlab/assert/checks.rb,
lib/rlab/assert/errors.rb,
lib/rlab/assert/syntax.rb,
lib/rlab/assert/version.rb,
lib/rlab/assert/assertion.rb,
lib/rlab/assert/refutation.rb,
lib/rlab/assert/checks/registry.rb,
lib/rlab/assert/minitest_integration.rb
Defined Under Namespace
Modules: Checks
Classes: Assertion, AssertionFailed, Check, MinitestIntegration, MissingCheck, NothingRaised, Refutation, Syntax
Constant Summary
collapse
- Error =
Class.new StandardError
- VERSION =
"0.1.2"
Class Method Summary
collapse
Class Method Details
.filter_trace(trace) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/rlab/assert.rb', line 14
def self.filter_trace trace
assert_root = __FILE__.chomp ".rb"
trace.drop_while do |location|
full_path = File.expand_path location.path
full_path.start_with? assert_root
end
end
|
.inspect(object, truncate = 100) ⇒ Object
22
23
24
25
26
|
# File 'lib/rlab/assert.rb', line 22
def self.inspect object, truncate = 100
raw = object.inspect
return raw if raw.size <= truncate
"#{raw[0..truncate - 2]} …\""
end
|