Help language development. Donate to The Perl Foundation

BDD::Behave cpan:GDONALD last updated on 2019-09-14

specs/004-spec.p6
use BDD::Behave;

describe -> 'foo bar' {
  let(:number) => { 42 };

  context -> 'bar baz' {
    it -> 'baz foo' {
      expect(42).to.be(42);
      expect(:number).to.be(42);
      expect(42).to.be(:number);
    }
  }

  context -> 'baz foo' {
    let(:number) => { '42' };

    it -> 'final foo bar has 3 expects' {
      expect('42').to.be('42');
      expect(:number).to.be('42');
      expect('42').to.be(:number);
    }
  }
}