Ho-Sheng Hsiao wrote:

> I have this exact problem. I'm refactoring the Foreigner gem and it
> has some dependencies against Rails. I originally took
> plugin_test_helper and attempted to make it more rspec compatible
> before I realized that I did not need to load the full Rails stack. I
> only needed ActiveSupport, ActiveRecord, and ActiveRecord::Migration
> to run my tests. I have those things loaded in the environment.

Ah, I see you are not actually using plugin_test_helper, on a re-read.

Can you explain what you mean by "I have those things loaded in the 
environment".  You load them in the environment how?  We're not talking 
"Rails app environment", because there is none in your tests of the 
plugin, right?

So are you just specifically loading the parts of Rails you need loaded 
in tests in your test code?  require rubygems, require active-support? 
Or something else?

Without Rails there, my _own_ classes don't seem to autoload, like they 
do in Rails. How are you loading all your own classes in so classes that 
reference each other can be tested?  Even if I wanted to just "require" 
each one, one by one -- circular dependencies seem to cause a problem 
with that. Which the Rails autoloader somehow gets around, but I don't 
know how to do it myself for testing without Rails.
-- 
Posted via http://www.ruby-forum.com/.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to