be

The word .be indicates a test for identity. For value types, this is equivalent to equality. It takes one parameter and terminates the phrase.

  1. void be(Should should, T expected, Fence _, string file, size_t line)
    void
    be
    (
    Should
    T
    )
    (
    Should should
    ,,
    Fence _ = Fence()
    ,
    string file = __FILE__
    ,
    size_t line = __LINE__
    )
    if (
    isInstanceOf!(ShouldType, Should) &&
    !should.hasWord!"approximately"
    )
  2. auto be(Should should)
  3. void be(Should should, T expected, ErrorValue error, Fence _, string file, size_t line)

Examples

2.should.be(2);
2.should.not.be(5);
(new Object).should.not.be(new Object);
(new Object).should.not.be(null);
(cast(Object) null).should.be(null);
(cast(void delegate()) null).should.be(null);

Meta