Re: [rspec-users] Using Mock / Datamapper / Associations

2009-11-13 Thread David Chelimsky
On Fri, Nov 13, 2009 at 10:04 AM, Arco wrote: > I'm using datamapper and have two associated classes: > - Org - has n, :users > - User - belongs_to :org > > When I test the User object, I have been able to mock/stub methods of > the Org object. Great! > > But - I still need to require 'org.rb' t

[rspec-users] Using Mock / Datamapper / Associations

2009-11-13 Thread Arco
I'm using datamapper and have two associated classes: - Org - has n, :users - User - belongs_to :org When I test the User object, I have been able to mock/stub methods of the Org object. Great! But - I still need to require 'org.rb' to setup my user tests - otherwise Datamapper will complain: "C

Re: [rspec-users] ruby file.spec?

2009-11-13 Thread rogerdpack
> What happens when you try it? > > (You *do* have the power to experiment, you know.  You don't need permission.) C:\dev\ruby\old\arguments\spec>ruby arguments_spec.rb arguments_spec.rb:5: undefined method `describe' for main:Object (NoMethodError) or adding a require 'spec' in there C:\dev\

Re: [rspec-users] undefined method `route_for

2009-11-13 Thread David Chelimsky
On Fri, Nov 13, 2009 at 2:28 AM, Amit Kulkarni wrote: > MY spec helper contains following code: > # This file is copied to ~/spec when you run 'ruby script/generate > rspec' > # from the project root directory. > ENV["RAILS_ENV"] ||= 'test' > require > > File.expand_path(File.join(File.dirname(__

Re: [rspec-users] undefined method `route_for

2009-11-13 Thread Amit Kulkarni
MY spec helper contains following code: # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] ||= 'test' require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) require 'spec' require 'webrat'