Sha256: b761d6fdbfb44a97ddd50c78235e45d334c78067e165bce1f7378799b7f25d59
Contents?: true
Size: 1.12 KB
Versions: 9
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
9 entries across 9 versions & 3 rubygems