Skip to content

Instantly share code, notes, and snippets.

@mattb20
Created July 5, 2018 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattb20/9090ecdb3d4927b0e34132e52718cf5e to your computer and use it in GitHub Desktop.
Save mattb20/9090ecdb3d4927b0e34132e52718cf5e to your computer and use it in GitHub Desktop.
class Printer
def initialize
end
def output(bank)
bank.transaction_history.each do |transaction|
puts transaction.join( ' || ')
end
end
end
require 'printer'
require 'bank'
describe Printer do
let(:printer) { described_class.new }
it 'will print something as expected' do
expect(STDOUT).to receive(:puts).with("date || credit || debit || balance\n22/05/2018 || 10.00 || || 10.00\n");
bank = Bank.new
bank.transaction_history = [["date || credit || debit || balance"],["22/05/2018", '10.00', " ", '10.00']]
printer.output(bank);
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment