spec/rake/funnel/support/timing/report_spec.rb in rake-funnel-0.21.0 vs spec/rake/funnel/support/timing/report_spec.rb in rake-funnel-0.21.1

- old
+ new

@@ -1,18 +1,15 @@ -include Rake -include Rake::Funnel::Support::Timing - describe Rake::Funnel::Support::Timing::Report do - include DSL + include Rake::DSL subject { described_class.new(stats, opts) } let(:opts) { {} } before do allow($stdout).to receive(:puts) - allow($stderr).to receive(:puts) + allow(Kernel).to receive(:warn) subject.render end shared_examples_for :report do it 'should separator lines' do @@ -42,24 +39,24 @@ context 'when rake failed' do let(:opts) { { failed: true } } it 'should print the failed build status' do - expect($stderr).to have_received(:puts).with(/Status\s+Failed/) + expect(Kernel).to have_received(:warn).with(/Status\s+Failed/) end end end - describe 'empty report' do - let(:stats) { Statistics.new } + describe 'empty report', include: Rake::Funnel::Support::Timing do + let(:stats) { Rake::Funnel::Support::Timing::Statistics.new } it_behaves_like :report end describe 'report for 2 tasks' do let(:stats) do - s = Statistics.new + s = Rake::Funnel::Support::Timing::Statistics.new s.benchmark(task(:foo)) {} s.benchmark(task(:bar)) {} s end @@ -75,10 +72,10 @@ end end describe 'formatting' do let(:stats) do - s = Statistics.new + s = Rake::Funnel::Support::Timing::Statistics.new s.benchmark(task(task_name)) {} s end let(:header_space) do