Sha256: 17c6087a5da5adef1106378746980568824b080ef36e85c07b544c4d60d09144

Contents?: true

Size: 966 Bytes

Versions: 2

Compression:

Stored size: 966 Bytes

Contents

#ifndef _WIN32
#include <specs/specs.h>

go_bandit([](){

  describe("colorizer: ", [&](){
  
    describe("colors enabled", [&](){
      bandit::detail::colorizer colorizer;
    
      it("can set color to green", [&](){
        AssertThat(colorizer.green(), Equals("\033[1;32m"));
      });

      it("set color to red", [&](){
        AssertThat(colorizer.red(), Equals("\033[1;31m"));
      });
      it("resets color", [&](){
        AssertThat(colorizer.reset(), Equals("\033[0m"));
      });
    
    });

    describe("colors disabled", [&](){
    
      bandit::detail::colorizer colorizer(false);

      it("ignores setting color to green", [&](){
        AssertThat(colorizer.green(), Equals(""));
      });

      it("ignores setting color to red", [&](){
        AssertThat(colorizer.red(), Equals(""));
      });

      it("ignores resetting colors", [&](){
        AssertThat(colorizer.reset(), Equals(""));
      });
    
    });
  
  });

});
#endif

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/reporters/colorizer.spec.cpp
tree-sitter-0.0.1 ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/colorizer.spec.cpp