Sha256: bd4f5ddb8e6f1a2c917e741b397a6576fa07df5553196c7b6999185a7b0c8a31
Contents?: true
Size: 1.54 KB
Versions: 18
Compression:
Stored size: 1.54 KB
Contents
# This test requires UI be not defined to simulate using plugin outside Guard require 'guard/compat/plugin' Guard.send(:remove_const, :UI) if Guard.const_defined?(:UI) RSpec.describe Guard::Compat do context 'when Guard is not loaded' do describe '.color' do it 'returns uncolored text' do expect(Guard::Compat::UI.color('foo', 'red')).to eq('foo') end end describe '.color_enabled?' do it 'returns false' do expect(Guard::Compat::UI.color_enabled?).to be(false) end end describe '.info' do it 'outputs to stdout' do expect($stdout).to receive(:puts).with('foo') Guard::Compat::UI.info('foo') end end describe '.warning' do it 'outputs to stdout' do expect($stdout).to receive(:puts).with('foo') Guard::Compat::UI.warning('foo') end end describe '.error' do it 'outputs to stdout' do expect($stderr).to receive(:puts).with('foo') Guard::Compat::UI.error('foo') end end describe '.debug' do it 'outputs to stdout' do expect($stdout).to receive(:puts).with('foo') Guard::Compat::UI.debug('foo') end end describe '.deprecation' do it 'outputs to stdout' do expect($stdout).to receive(:puts).with('foo') Guard::Compat::UI.deprecation('foo') end end describe '.notify' do it 'outputs to stdout' do expect($stdout).to receive(:puts).with('foo') Guard::Compat::UI.notify('foo') end end end end
Version data entries
18 entries across 18 versions & 9 rubygems