abstract class Object
Overview
Object
is the base type of all Crystal objects.
Included Modules
- Colorize::ObjectExtensions
Defined in:
spectator/should.crInstance Method Summary
-
#should(matcher)
Extension method to create an expectation for an object.
-
#should_eventually(matcher)
Works the same as
#should
except that the condition check is postphoned. -
#should_never(matcher)
Works the same as
#should_not
except that the condition check is postphoned. -
#should_not(matcher)
Works the same as
#should
except the condition is inverted.
Instance Method Detail
Extension method to create an expectation for an object. This is part of the spec DSL and mimics Crystal Spec's default should-syntax. A matcher should immediately follow this method, or be the only argument to it. Example usage:
it "equals the expected value" do
subject.should eq(42)
end
NOTE By default, the should-syntax is disabled.
The expect-syntax is preferred,
since it doesn't monkey-patch all objects.
To enable should-syntax, add the following to your spec_helper.cr
file:
require "spectator/should"
Works the same as #should
except that the condition check is postphoned.
The expectation is checked after the example finishes and all hooks have run.
Works the same as #should_not
except that the condition check is postphoned.
The expectation is checked after the example finishes and all hooks have run.