Sha256: a2c78cf536d311b4e11545ec243a0eda7297a67b69e9a7b082192c51a660a8e4

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

describe FlareUp::Emitter do

  describe '.sanitize' do

    context 'when colorize output is disabled' do
      before do
        FlareUp::Emitter.store_options({:colorize_output => false})
      end
      it 'should remove color codes' do
        expect(FlareUp::Emitter.sanitize("\x1b[31mHello, World")).to eq('Hello, World')
      end
    end

    context 'when a risky option is being output' do
      before do
        FlareUp::Emitter.store_options({:aws_access_key => 'foo'})
      end
      it 'should hide it' do
        expect(FlareUp::Emitter.sanitize('Hellofoo')).to eq('HelloREDACTED')
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flare-up-0.7 spec/lib/flare_up/emitter_spec.rb
flare-up-0.6 spec/lib/flare_up/emitter_spec.rb