Created
July 5, 2018 13:27
-
-
Save mattb20/c50851f5b3abe7ef0ada62af7d800136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Printer | |
def initialize | |
end | |
def output(bank) | |
bank.transaction_history.each do |transaction| | |
puts transaction.join( ' || ') | |
end | |
end | |
end | |
require 'printer' | |
require 'date' | |
describe Printer do | |
let(:printer) { described_class.new } | |
let(:bank) { double 'bank', :transaction_history [["date || credit || debit || balance"],["22/05/2018", '10.00', " ", '10.00']] } | |
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"); | |
printer.output(bank); | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment