Sha256: 46a909f465d144a4f322b7d136c2afebb16382755474962ffb8ae870fd0bf872
Contents?: true
Size: 391 Bytes
Versions: 11
Compression:
Stored size: 391 Bytes
Contents
# encoding: utf-8 RSpec.describe Pastel::Color, '#colored?' do subject(:color) { described_class.new(enabled: true) } it "checks if string has color codes" do string = "foo\e[31mbar\e[0m" expect(color.colored?(string)).to eq(true) end it "checks that string doesn't contain color codes" do string = "foo\nbar" expect(color.colored?(string)).to eq(false) end end
Version data entries
11 entries across 11 versions & 2 rubygems