Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
Yup, I did. Thanks all. (unless anyone has any comments on the constants question I just asked in a previous post?) Regards Matt 2009/12/14 Tom Stuart > On 14 Dec 2009, at 21:28, Matt Riches wrote: > > describe Address do > > #Test Fixture - Before Each test Create a Standard Bread with the

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
I am still learning, and its been along and frustrating day, but thanks ! Sometimes a fresh (more experienced pair of eyes) can spot the blindingly obvious :) ok, one more quick question, and its slightly more general and then Im going home for the day. When I run my tests now I get a series of

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Tom Stuart
On 14 Dec 2009, at 21:28, Matt Riches wrote: > describe Address do > #Test Fixture - Before Each test Create a Standard Bread with the following > attributes and properties > before(:each) do > @address = { > :business_name => 'business', :first_line => '10, This Street', > :second_

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Vishu Ramanathan
This should have been the giveaway > undefined method 'status' for #<*Hash*...> In your before you're assigning @address to the parameters, not to a new address @address = {:foo => 'bar'} instead of @address = Address.new({:foo => 'bar'}) -V On Mon, Dec 14, 2009 at 3:28 PM, Matt Riches wrote

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
Fair point, thought you could also assume that the omissions are down to my newness at RSpec and RoR :-) The whole of the code is rather large, I am being asked to retrofit rspec onto the code base as things are changed, so I am only showing what I think are the relevent things.. Code Section 1

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread David Salgado
Looks like you forgot to put "do" at the end of your specs. I do that all the time; it "should have a status of New Record" ... Should be it "should have a status of New Record" do ... HTH David 2009/12/14 Tom Stuart : > On 14 Dec 2009, at 20:36, Matt Riches wrote: >> 1) Why are my methods u

Re: [rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Tom Stuart
On 14 Dec 2009, at 20:36, Matt Riches wrote: > 1) Why are my methods undefined, when they are there (I can create the object > via script/console and call the status and reset methods and see them work) > 2) What is the best way of resolving the issue You'd be much better off using pastie.org to

[rspec-users] RSPEC and RoR undefined method for hash when running model tests

2009-12-14 Thread Matt Riches
Within my project, I have a number of models that have additional methods within them other than those provided by active record. as an example (to keep it short and sweet) class foo < ActiveRecod::Base def status "New Record" end def reset "Reset" end end in my spec file I have req