Sha256: 81b00e56c7a44a77e7cb5171fc86a6c0b859c6b965ede20ff8d00b33989b5c41
Contents?: true
Size: 1.12 KB
Versions: 10
Compression:
Stored size: 1.12 KB
Contents
require "spec_helper" MetricFu.lib_require { 'reporter' } describe MetricFu::Reporter do context 'given a single formatter' do before do @formatter = double('formatter') allow(@formatter).to receive(:to_a).and_return([@formatter]) @reporter = Reporter.new(@formatter) end it 'notifies the formatter' do expect(@formatter).to receive(:start) expect(@formatter).to receive(:finish) @reporter.start @reporter.finish end it 'only sends notifications when supported by formatter' do allow(@formatter).to receive(:respond_to?).with(:display_results).and_return(false) expect(@formatter).not_to receive(:display_results) @reporter.display_results end end context 'given multiple formatters' do before do @formatters = [double('formatter'), double('formatter')] @reporter = Reporter.new(@formatters) end it 'notifies all formatters' do @formatters.each do |formatter| expect(formatter).to receive(:start) expect(formatter).to receive(:finish) end @reporter.start @reporter.finish end end end
Version data entries
10 entries across 10 versions & 1 rubygems