# encoding: utf-8 require 'spec_helper' describe Actions::PrintNewline do context '#initialize' do it 'has no special requirements' do expect { Actions::PrintNewline.new }.not_to raise_error end it 'accepts a count' do expect { Actions::PrintNewline.new(2) }.not_to raise_error end end context '#run' do it 'prints 1 newline' do result = capture(:stdout) do Actions::PrintNewline.new.run end expect(result).to eq("\n") end it 'prints 2 newlines' do result = capture(:stdout) do Actions::PrintNewline.new(2).run end expect(result).to eq("\n\n") end end end