Re: [rspec-users] How can I create a active-record model w/o depending on the database?

2012-09-23 Thread David Chelimsky
On Sun, Sep 23, 2012 at 8:56 PM, S Ahmed wrote: > Yes, I think I get it. > > The actual class can interact since it is kinda necessary and vital to > testing int anyhow, but when other classes are depending on MyClass, you can > stub/mock since they are outside the scope or domain of the MyClass,

Re: [rspec-users] How can I create a active-record model w/o depending on the database?

2012-09-23 Thread S Ahmed
Yes, I think I get it. The actual class can interact since it is kinda necessary and vital to testing int anyhow, but when other classes are depending on MyClass, you can stub/mock since they are outside the scope or domain of the MyClass, so they shouldn't have to be depending on the dependancies

Re: [rspec-users] How can I create a active-record model w/o depending on the database?

2012-09-23 Thread David Chelimsky
On Sun, Sep 23, 2012 at 7:55 PM, S Ahmed wrote: > I have a class that takes a class that inherits from activerecord as a > parameter, e.g.: > > class SomeModel < ActiveRecord::Base > end > > class MyClass > attr_accessor :model > def initialize(model) > @model = model > end > end > > > T

[rspec-users] How can I create a active-record model w/o depending on the database?

2012-09-23 Thread S Ahmed
I have a class that takes a class that inherits from activerecord as a parameter, e.g.: class SomeModel < ActiveRecord::Base end class MyClass attr_accessor :model def initialize(model) @model = model end end The class MyClass will then iterate over the Models attributes etc. Also I