Sha256: 80893ad942492e4e448c38753dd4635b18e2b761f27c568742d75511bc803737
Contents?: true
Size: 737 Bytes
Versions: 13
Compression:
Stored size: 737 Bytes
Contents
require 'xcpretty/syntax' module XCPretty describe Syntax do before(:each) do Syntax.instance_variable_set(:@available, nil) end it "caches the pygments availability" do Syntax.should_receive(:system).once.and_return(false) 4.times { Syntax.highlight('meh') } end context "pygments are installed" do it "highlights code" do Syntax.stub(:system).and_return(true) Syntax.highlight('int a = 5;').should include("\e[36mint\e[39;49;00m") end end context "pygments are not installed" do it "prints plain code" do Syntax.stub(:system).and_return(false) Syntax.highlight('int a = 5;').should == 'int a = 5;' end end end end
Version data entries
13 entries across 13 versions & 2 rubygems