spec/rake/funnel/support/patch_spec.rb in rake-funnel-0.22.1 vs spec/rake/funnel/support/patch_spec.rb in rake-funnel-0.22.2
- old
+ new
@@ -15,27 +15,27 @@
describe 'with definition' do
subject do
described_class.new do |p|
p.setup do
- output.puts 'setup'
+ output.print 'setup'
42
end
p.reset do |memo|
- output.puts memo
+ output.print memo
end
end
end
let(:output) { double.as_null_object }
context 'when applying the patch' do
let!(:ret) { subject.apply! }
it 'should execute the setup' do
- expect(output).to have_received(:puts).with('setup')
+ expect(output).to have_received(:print).with('setup')
end
it 'should return self' do
expect(ret).to eq(subject)
end
@@ -46,11 +46,11 @@
subject.apply!
subject.revert!
end
it 'should execute the reset' do
- expect(output).to have_received(:puts).with(42)
+ expect(output).to have_received(:print).with(42)
end
it 'should return self' do
expect(ret).to eq(subject)
end
@@ -58,22 +58,22 @@
context 'when reverting an unapplied patch' do
before { subject.revert! }
it 'should not execute the reset' do
- expect(output).not_to have_received(:puts).with(42)
+ expect(output).not_to have_received(:print).with(42)
end
end
context 'when applying twice' do
before do
subject.apply!
subject.apply!
end
it 'should execute the setup once' do
- expect(output).to have_received(:puts).with('setup').once
+ expect(output).to have_received(:print).with('setup').once
end
end
context 'when reverting twice' do
before do
@@ -81,28 +81,28 @@
subject.revert!
subject.revert!
end
it 'should execute the revert once' do
- expect(output).to have_received(:puts).with(42).once
+ expect(output).to have_received(:print).with(42).once
end
end
describe 'context' do
let(:context) { 42 }
subject do
described_class.new(context) do |p|
p.setup do |context|
- output.puts context
+ output.print context
end
end
end
before { subject.apply!.revert! }
it 'should be accessible from within the patch definition' do
- expect(output).to have_received(:puts).with(42)
+ expect(output).to have_received(:print).with(42)
end
end
end
end