Sha256: 95bfd6fd413d66d294fe49f7345bb9ebb2ad94b1d8036546663f74c16c41fd40

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

Contents

#include <specs/specs.h>

go_bandit([](){
  describe("my first spec", [&]() {
    int a;

    before_each([&](){
      a = 99;
    });

    it("should be initialized", [&](){
      AssertThat(a, Equals(99));
      a = 102;
    });

    describe("nested spec", [&](){

      before_each([&](){
        a += 3;
      });

      it("should build on outer spec", [&](){
        AssertThat(a, Equals(102));
        a = 666;
      });

      it("should build on outer spec yet again", [&](){
        AssertThat(a, Equals(102));
        a = 667;
      });

    });

    it("should be initialized before each it", [&](){
      AssertThat(a, Equals(99));
    });
  });

  describe("my second spec", [&](){
    int b;

    before_each([&](){
      b = 22;
    });

    before_each([&](){
      b += 3;
    });

    it("should be 25", [&](){
      AssertThat(b, Equals(25));
    });
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tree-sitter-0.1.0 ext/tree-sitter/tree-sitter/externals/bandit/specs/synopsis.spec.cpp
tree-sitter-0.0.1 ext/tree-sitter/tree-sitter/externals/bandit/specs/synopsis.spec.cpp