spec/rake/funnel/integration/progress_report_spec.rb in rake-funnel-0.21.0 vs spec/rake/funnel/integration/progress_report_spec.rb in rake-funnel-0.21.1

- old
+ new

@@ -1,18 +1,15 @@ -include Rake -include Rake::Funnel::Integration - describe Rake::Funnel::Integration::ProgressReport do - include DSL + include Rake::DSL let(:teamcity_running?) { false } before do allow($stdout).to receive(:puts) - allow(TeamCity).to receive(:running?).and_return(teamcity_running?) + allow(Rake::Funnel::Integration::TeamCity).to receive(:running?).and_return(teamcity_running?) - Task.clear + Rake::Task.clear end after do subject.disable! end @@ -23,11 +20,11 @@ end before do task :task - Task[:task].invoke + Rake::Task[:task].invoke end context 'not on TeamCity' do it 'should write colored task name in square brackets' do expect($stdout).to have_received(:puts).with("\n[task]".bold.cyan) @@ -51,11 +48,11 @@ before do subject.disable! task :task - Task[:task].invoke + Rake::Task[:task].invoke end it 'should not write' do expect($stdout).not_to have_received(:puts).with("\n[task]") end @@ -81,38 +78,38 @@ context 'when task succeeds' do before do task :task - Task[:task].invoke + Rake::Task[:task].invoke end describe 'starting handler' do it 'should run' do expect(receiver).to have_received(:task_starting) end it 'should receive task' do - expect(receiver).to have_received(:task_starting).with(hash_including(task: kind_of(Task))) + expect(receiver).to have_received(:task_starting).with(hash_including(task: kind_of(Rake::Task))) end it 'should receive task arguments' do - expect(receiver).to have_received(:task_starting).with(hash_including(args: kind_of(TaskArguments))) + expect(receiver).to have_received(:task_starting).with(hash_including(args: kind_of(Rake::TaskArguments))) end end describe 'finished handler' do it 'should run' do expect(receiver).to have_received(:task_finished) end it 'should receive task' do - expect(receiver).to have_received(:task_finished).with(hash_including(task: kind_of(Task))) + expect(receiver).to have_received(:task_finished).with(hash_including(task: kind_of(Rake::Task))) end it 'should receive task arguments' do - expect(receiver).to have_received(:task_finished).with(hash_including(args: kind_of(TaskArguments))) + expect(receiver).to have_received(:task_finished).with(hash_including(args: kind_of(Rake::TaskArguments))) end it 'should not receive error' do expect(receiver).to have_received(:task_finished).with(hash_including(error: nil)) end @@ -128,10 +125,10 @@ task :task do raise error end begin - Task[:task].invoke + Rake::Task[:task].invoke rescue SpecificError # rubocop:disable Lint/HandleExceptions end end describe 'finished handler' do