MrBanabas-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jan-09 21:28 UTC
Type error in unit test
Hi,
I ve got a really strange issue with one of my test unit files...
When I run that test unit I get a Type Error:
test_planned_records_with_done_records(RindTod):
TypeError: {:rind=>#<Rind:0x4bdcfc8 @unsaved=false,
@rind_daten=[#<RindBrunst:0x
4f80300 @first_planungsdatum_change=false,
@attributes={"test_ergebnis_id"=>"2",
"updated_at"=>"2008-01-09 22:22:28",
"planungsdatum"=>"2009-05-19",
"gewicht"=>
nil, "todes_art_id"=>nil,
"rind_mehrling_anzahl_id"=>nil,
"planungsregel_id"=>"3
", "rind_id"=>"6",
"hinten_links"=>"1",
"vorne_links"=>"1",
"start_laktzyklus"=>
nil, "land_id"=>nil, "lock_version"=>"0",
"bemerkung"=>nil,
"kurzinfo"=>"Ergebni
s: Unbekannt", "datum"=>nil, "type"=>"Rind
./test/unit/rind_tod_test.rb:53:in `new''
./test/unit/rind_tod_test.rb:53:in
`test_planned_records_with_done_records''
I ve got absolutely no idea why that error is happening.
Maybe anybody has an idea what might be the reason?
Thanks a lot.
--
Volker
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Can you show us the code around line 53 in this file please: ./test/unit/rind_tod_test.rb On Jan 10, 2008 7:58 AM, MrBanabas-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org <MrBanabas-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi, > > I ve got a really strange issue with one of my test unit files... > > When I run that test unit I get a Type Error: > test_planned_records_with_done_records(RindTod): > TypeError: {:rind=>#<Rind:0x4bdcfc8 @unsaved=false, > @rind_daten=[#<RindBrunst:0x > 4f80300 @first_planungsdatum_change=false, > @attributes={"test_ergebnis_id"=>"2", > "updated_at"=>"2008-01-09 22:22:28", "planungsdatum"=>"2009-05-19", > "gewicht"=> > nil, "todes_art_id"=>nil, "rind_mehrling_anzahl_id"=>nil, > "planungsregel_id"=>"3 > ", "rind_id"=>"6", "hinten_links"=>"1", "vorne_links"=>"1", > "start_laktzyklus"=> > nil, "land_id"=>nil, "lock_version"=>"0", "bemerkung"=>nil, > "kurzinfo"=>"Ergebni > s: Unbekannt", "datum"=>nil, "type"=>"Rind > ./test/unit/rind_tod_test.rb:53:in `new'' > ./test/unit/rind_tod_test.rb:53:in > `test_planned_records_with_done_records'' > > I ve got absolutely no idea why that error is happening. > > Maybe anybody has an idea what might be the reason? > > Thanks a lot. > > -- > Volker > > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
MrBanabas-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jan-21 18:34 UTC
Re: Type error in unit test
Sorry, it took so long to answer....
@my_cattle = Cattle.find_by_name("lisa")
my_tod = CattleDeath.new(:planungsdatum => Date.today + 20,
:datum => Date.today + 20,
:todes_art =>
TodesArt.find_by_hit_code_nr(1),
:rind => @my_rind)
my_tod.save!
Error is happening in CattleDeath.new()
On 10 Jan., 00:21, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Can you show us the code around line 53 in this file please:
> ./test/unit/rind_tod_test.rb
>
> On Jan 10, 2008 7:58 AM, MrBana...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
<MrBana...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> wrote:
>
>
>
>
>
> > Hi,
>
> > I ve got a really strange issue with one of my test unit files...
>
> > When I run that test unit I get a Type Error:
> > test_planned_records_with_done_records(RindTod):
> > TypeError: {:rind=>#<Rind:0x4bdcfc8 @unsaved=false,
> > @rind_daten=[#<RindBrunst:0x
> > 4f80300 @first_planungsdatum_change=false,
> > @attributes={"test_ergebnis_id"=>"2",
> > "updated_at"=>"2008-01-09 22:22:28",
"planungsdatum"=>"2009-05-19",
> > "gewicht"=>
> > nil, "todes_art_id"=>nil,
"rind_mehrling_anzahl_id"=>nil,
> > "planungsregel_id"=>"3
> > ", "rind_id"=>"6",
"hinten_links"=>"1",
"vorne_links"=>"1",
> > "start_laktzyklus"=>
> > nil, "land_id"=>nil,
"lock_version"=>"0", "bemerkung"=>nil,
> > "kurzinfo"=>"Ergebni
> > s: Unbekannt", "datum"=>nil,
"type"=>"Rind
> > ./test/unit/rind_tod_test.rb:53:in `new''
> > ./test/unit/rind_tod_test.rb:53:in
> > `test_planned_records_with_done_records''
>
> > I ve got absolutely no idea why that error is happening.
>
> > Maybe anybody has an idea what might be the reason?
>
> > Thanks a lot.
>
> > --
> > Volker
>
> --
> Ryan Bigghttp://www.frozenplague.net
> Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---