Sha256: 1ec386123d144f03c6f462285f297e3cb9b1f07fcd3a41764f0db77440bf39be
Contents?: true
Size: 631 Bytes
Versions: 26
Compression:
Stored size: 631 Bytes
Contents
require 'rspec' unless Object.const_defined? :RSpec RSpec::Matchers.define :be_colored do |expected| def effects_string(actual) effects = applied_effects(actual).join(' and ') effects.length > 0 ? effects : "unformatted" end match do |actual| applied_effects(actual).include? expected.to_sym end failure_message_for_should do |actual| "expected that '#{strip(actual)}' would be colored #{expected}, but was #{effects_string(actual)}" end failure_message_for_should_not do |actual| "expected that #{strip(actual)} would not be colored #{expected}, but was #{effects_string(actual)}" end end
Version data entries
26 entries across 26 versions & 3 rubygems