Created
July 5, 2018 16:14
-
-
Save mattb20/9090ecdb3d4927b0e34132e52718cf5e to your computer and use it in GitHub Desktop.
This file contains 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 | |
This file contains 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
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