Forum: Ruby on Rails NOOB question RSPEC

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fefo (Guest)
on 2007-05-14 17:26
(Received via mailing list)
Hi all !!

I have this code:
require 'account'

describe Account, "when first created" do
  before do
    @account = Account.new
  end

  it "should have a balance of $0" do
    @account.balance.should eql(Money.new(0, :dollars))
  end

  after do
    @account = nil
  end
end

How can I pass the @account.balance.should eql(Money.new(0, :dollars))
spec. From my understanding you .eql? in ruby is true if the object
are the same (reference points to same object) or if one inherits the
other.
But still can make it work.

Thanks !
Steve R. (Guest)
on 2007-05-14 21:53
(Received via mailing list)
Where are you getting the Money class and what result are you
getting? eql? requires that eql?() be defined in that class.

Also, you might cross-post to rSpec group.

removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users
This topic is locked and can not be replied to.