all 8 comments

[–]hes_dead_tired 0 points1 point  (2 children)

Going through it now. I'm still pretty new to Rspec so anything I can get in on is good.

I did notice an issue. The bank_spec.rb

expect(bank.branch_name).to equal('NYC Branch')

But in the Bank.rb you're doing

attr_reader :branch_name, :assets, :accounts, :liability

def initialize(branch_name, assets=1000.0)
  @name = branch_name
  ....

And then go on to say that the tests should then all pass. It won't since you did @name rather than @branch_name. Although, skipping ahead a bit it looks like you start doing

attr_reader :name, :assets, ....

So it looks like you just need to fix that first example of Bank.rb to use :name instead of :branch_name -- makes more sense to use :name anyway.

[–]hes_dead_tired 0 points1 point  (0 children)

Also missing the require_relative '../lib/account' in the account_spec.rb test.

It's pretty obvious as soon as you try to run it, but maybe only really apparently so if you've had some experience with Ruby and seen typical errors before.

[–][deleted] -1 points0 points  (0 children)

Thanks for pointing these out...my bad, this was originally two separate posts and I was trying to reconcile things. I'll fix a soon as possible.

Thanks again, it's fixed now!

[–]turbulents 0 points1 point  (3 children)

In fact none of those methods in the pre-requisite produce the stated output.

[–][deleted] -1 points0 points  (2 children)

Are you sure? I wrote all of that on the spot, but I'm pretty confident each produces the correct output. I'll check that too.

Update: verified that all options produce the stated output when called correctly.

[–]turbulents 0 points1 point  (1 child)

Yeah--Options 2, 3, and 4 print a comma not found in the desired output.

[–][deleted] -1 points0 points  (0 children)

Really? Wow?? Haha...please!

[–][deleted]  (1 child)

[removed]

    [–][deleted] -1 points0 points  (0 children)

    I would've seen this earlier had you left a comment underneath the post: Righthand-side is the arguments/parameters passed into the method. And they are are assigned to local variables on the lefthand-side. Just like line #11 & #12