Validates an expectation and fails the example if it does not match.
Validates an expectation and fails the example if it does not match.
Validates an expectation and fails the example if it matches.
Validates an expectation and fails the example if it matches.
Validates an expectation and fails the example if it matches.
Validates an expectation and fails the example if it does not match.
This overload returns a value whose type is restricted to the expected type. For example:
x = 1 || 'a' typeof(x) # => Int32 | Char x = x.should be_a(Int32) typeof(x) # => Int32
See Spec::Expecations
for available expectations.
Validates an expectation and fails the example if it does not match.
See Spec::Expecations
for available expectations.
Validates an expectation and fails the example if it matches.
This overload returns a value whose type is restricted to exclude the given type in should_not be_a
. For example:
x = 1 || 'a' typeof(x) # => Int32 | Char x = x.should_not be_a(Char) typeof(x) # => Int32
See Spec::Expecations
for available expectations.
Validates an expectation and fails the example if it matches.
This overload returns a value whose type is restricted to be not Nil
. For example:
x = 1 || nil typeof(x) # => Int32 | Nil x = x.should_not be_nil typeof(x) # => Int32
See Spec::Expecations
for available expectations.
Validates an expectation and fails the example if it matches.
See Spec::Expecations
for available expectations.
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Spec/ObjectExtensions.html