very bizzare but whilst I needed to use this approach to fix one of my tests, I realised the test before was working without having to make it a big decimal - go figure :)
-------------------------------- it "should return last IR when date > last interest rate" do @source_bank.ir(Time.now.to_date + 1.years).should == 8.5 # <== WORKED FINE end it "should return latest IR not greater than date specified when a date is passed" do @source_bank.ir(Time.now.to_date + 8.days).should == BigDecimal.new('6.5') # <== NEEDED TO USE BigDecimal here end -------------------------------- On Sat, Nov 8, 2008 at 3:37 PM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > thanks Pat - yes I missed it when reading your email - I'd been using > ".eql" for everything....thanks > > On Sat, Nov 8, 2008 at 2:10 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: >> "Greg Hauptmann" <[EMAIL PROTECTED]> writes: >> >>> in fact I guess I was fishing for an easier way than this...if one >>> exists? or is ruby & rspec "eql()" just strict here in terms of >>> types? >>> >>> On 11/7/08, Mark Wilden <[EMAIL PROTECTED]> wrote: >>>> On Fri, Nov 7, 2008 at 3:24 PM, Greg Hauptmann < >>>> [EMAIL PROTECTED]> wrote: >>>> >>>>> >>>>> expected 6.5, got #<BigDecimal:23d8284,'0.65E1',8(8)> (using .eql?) >>>>> >>>> >>>> How about just expecting BigDecimal('5.5')? >>>> >>>> ///ark >>>> >> >> I'm not sure if you got my email before, but 6.5 == >> BigDecimal.new('6.5'). So use == instead and you should be good. >> >> Pat >> _______________________________________________ >> rspec-users mailing list >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users