spec/rake/funnel/tasks/bin_path_spec.rb in rake-funnel-0.22.1 vs spec/rake/funnel/tasks/bin_path_spec.rb in rake-funnel-0.22.2
- old
+ new
@@ -20,11 +20,11 @@
let(:path_modifier) { nil }
before do
allow(ENV).to receive(:[]).with('PATH').and_return(default_path)
allow(ENV).to receive(:[]=)
- allow(Rake).to receive(:rake_output_message)
+ allow($stderr).to receive(:print)
end
subject do
described_class.new do |t|
t.search_pattern = search_pattern
@@ -54,12 +54,12 @@
it 'should append original PATH environment variable' do
expect(ENV).to have_received(:[]=).with('PATH', /#{default_path}$/)
end
it 'should report added paths' do
- expect(Rake).to have_received(:rake_output_message).with(%r{/foo$})
- expect(Rake).to have_received(:rake_output_message).with(%r{/bar$})
+ expect($stderr).to have_received(:print).with(%r{/foo$})
+ expect($stderr).to have_received(:print).with(%r{/bar$})
end
describe 'path modifier' do
context 'adding paths' do
let(:path_modifier) { proc { |paths| paths.push('added path') } }
@@ -96,10 +96,10 @@
before do
Rake::Task[subject.name].invoke
end
it 'should not print message' do
- expect(Rake).not_to have_received(:rake_output_message)
+ expect($stderr).not_to have_received(:print)
end
it 'should not set environment variable' do
expect(ENV).not_to have_received(:[]=).with('PATH')
end