Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-02-02 Thread James Byrne
James Byrne wrote: > > I have one other difficulty when running this on MS-WinXPpro under > cygwin. The newline character seems to have no effect. I can force it > to behave locally by adding a \r in front of each \n but, obviously, > that will have unfortunate consequences on *nix. Actually

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-02-02 Thread James Byrne
James Byrne wrote: > > What is happening is that RSpec is blowing up at its own logger code in > the default spec_helper.rb file. This happens whether or not ActAsFu is > installed and whether or not my custom logger is commented out in > environment.rb I poked at this a bit and hit upon the

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
Glad it works. Just so you know, you can get created_at and updated_at by calling #timestamps: require 'rubygems' require 'acts_as_fu' require 'spec' describe "timestamps" do before(:each) do build_model(:people) { timestamps } @person = Person.create!

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
James Byrne wrote: > Pat Nakajima wrote: >> James, >> >> Can you show me how you're trying to use ActsAsFu? >> >> Pat > > Not easily, because I removed the code. When I get a moment I will > reset it and post here. It will be later today. Here is what I have. FYI once I removed the custom l

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > James, > > Can you show me how you're trying to use ActsAsFu? > > Pat Not easily, because I removed the code. When I get a moment I will reset it and post here. It will be later today. -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > After taking another look, I think you may be able to do something > like this to test your logger: > https://gist.github.com/3c55cbec990f283c5399 I am not trying to test my custom logger. That part has worked for a few weeks now. What is happening is that RSpec is blowin

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
After taking another look, I think you may be able to do something like this to test your logger: https://gist.github.com/3c55cbec990f283c5399 Let me know if that works. Pat On Jan 30, 11:10 am, James Byrne wrote: > Pat Nakajima wrote: > > If you want an easy way to test ActiveRecord extensions

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
James, Can you show me how you're trying to use ActsAsFu? Pat On Jan 30, 11:52 am, James Byrne wrote: > Pat Nakajima wrote: > > If you want an easy way to test ActiveRecord extensions, check out > > acts_as_fu:http://github.com/nakajima/acts_as_fu. It makes generating > > ActiveRecord models de

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. Perhaps I misunderstood what this gem is supposed to provide but when I call create! on an object p

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread Pat Nakajima
So, in acts_as_fu, I actually set the ActiveRecord logger to just log to a StringIO that you can inspect by calling ActsAsFu.log. That's not going to fly for your project though, so let me give the ability to set your own. It'll be committed soon. - Pat On Jan 30, 11:10 am, James Byrne wrote: >

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
James Byrne wrote: > > and when I run rake spec I see this: > > NameError in 'Role should create a new instance given valid attributes' > undefined local variable or method `logger' for > # > /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in > > `meth

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. > This seems to work very well. However, I am causing myself a problem with the logger and I coul

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-30 Thread James Byrne
Pat Nakajima wrote: > (Sorry if this is double-posted, I was having trouble with joining the > list) > > If you want an easy way to test ActiveRecord extensions, check out > acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating > ActiveRecord models dead simple. > > Pat This see

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-29 Thread Ben Mabey
Pat Nakajima wrote: (Sorry if this is double-posted, I was having trouble with joining the list) If you want an easy way to test ActiveRecord extensions, check out acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating ActiveRecord models dead simple. Pat Very slick. I'll

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-29 Thread Pat Nakajima
(Sorry if this is double-posted, I was having trouble with joining the list) If you want an easy way to test ActiveRecord extensions, check out acts_as_fu: http://github.com/nakajima/acts_as_fu. It makes generating ActiveRecord models dead simple. Pat On Jan 29, 10:18 pm, Ben Mabey wrote: > Jam

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-29 Thread Ben Mabey
James Byrne wrote: Ben Mabey wrote: You can then use the dummy AR classes in your specs with an in-memory DB. I hope that helps, Ben Oh, yes. very much. Especially this example. def setup_db ActiveRecord::Schema.define(:version => 1) do Have you, or anyone reading thi

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-29 Thread James Byrne
Ben Mabey wrote: > > You can then use the dummy AR classes in your specs with an in-memory > DB. > > I hope that helps, > > Ben Oh, yes. very much. Especially this example. > def setup_db > ActiveRecord::Schema.define(:version => 1) do Have you, or anyone reading this, had any experience

Re: [rspec-users] RSpec - Testing ActiveRecord addins

2009-01-29 Thread Ben Mabey
James B. Byrne wrote: I wish to test a small library that I have written. The module resides in a file in ./lib. It is loaded in the application via a a file in ./config/initializers that contains the following code: require 'hll_audit_stamps' ActiveRecord::Base include ActiveRecord::HLLA