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.
rspec-users-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rspec-users
On May 14, 2007, at 6:25 AM, Fefo wrote:
>
> 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 !
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---