spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb in rake-funnel-0.22.1 vs spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb in rake-funnel-0.22.2

- old
+ new

@@ -2,11 +2,11 @@ before do allow(ENV).to receive(:[]).with(described_class::ENV_VAR).and_return(env_var) allow(Rake::Funnel::Support::Which).to receive(:which).and_return(which) allow(Dir).to receive(:glob).and_return([]) allow(RakeFileUtils).to receive(:mkdir_p) - allow(Rake).to receive(:rake_output_message) + allow($stderr).to receive(:print) end before do allow(Rake::Funnel::Support::BinaryVersionReader).to receive(:read_from) .with(which).and_return(nunit_version) @@ -42,13 +42,13 @@ File.join(File.dirname(which), 'addins'), preserve: true) end it 'should report that the addin is installed' do - expect(Rake).to \ - have_received(:rake_output_message) - .with("Installing TeamCity NUnit addin for version #{plugin_version} in #{which}") + expect($stderr).to \ + have_received(:print) + .with("Installing TeamCity NUnit addin for version #{plugin_version} in #{which}\n") end context 'Windows-style path in environment variable', skip: !Gem.win_platform? do let(:env_var) { 'C:\path\to\nunit plugins\nunit-' } @@ -88,13 +88,13 @@ context 'NUnit executable without version' do let(:env_var) { '/path/to/nunit plugins/nunit' } let(:which) { 'path/to/nunit-console.exe' } it 'should report that the version could not be read' do - expect(Rake).to \ - have_received(:rake_output_message) - .with("Could read version from NUnit executable in #{which}") + expect($stderr).to \ + have_received(:print) + .with("Could read version from NUnit executable in #{which}\n") end it 'should skip' do expect(Dir).not_to have_received(:glob) end @@ -104,11 +104,11 @@ let(:env_var) { '/path/to/nunit plugins/nunit' } let(:which) { 'path/to/nunit-console.exe' } let(:nunit_version) { Rake::Funnel::Support::VersionInfo.new(file_version: '1.2.3.4') } it 'should report that the addin version is not available' do - expect(Rake).to \ - have_received(:rake_output_message) + expect($stderr).to \ + have_received(:print) .with(/Could not find TeamCity NUnit addin for version 1\.2\.3 in .*#{env_var}$/) end it 'should skip' do expect(RakeFileUtils).not_to have_received(:mkdir_p)