Comments (12)
Would it be out of the question to rework your inheritance scheme so that ApplicationController does inherit straight from "ActionController::Base" ?
IE:
class ApplicationController < ApplicationController::Base
end
class BaseApplicationController < ApplicationController
end
class UsersController < BaseApplicationController
end
In other words, what is specific motivation for ApplicationController not inheriting from ApplicationController::Base?
Loading the real file is problematic because it will start to grab and preload all sorts of dependencies from your app, causing you to have to restart Spork more often in order for it to see your changes. (additionally, it's not feasible to NOT preload ApplicationController, because rspec-rails WILL, along with all of your ApplicationController's dependencies).
from spork.
If the above isn't feasible, one possible option would be to create an over-ridable configuration parameter on Spork specifying where the preloadable-bare-bones ApplicationController lies, causing Spork to direct any attempt to load ApplicatonController there rather than it's own stubbish ApplicationController.
from spork.
+1.
Maybe I'm the only one in the world doing this, but I consider this a bug in spork.
Certainly, though, the inheritance scheme could use a module instead of a class.
from spork.
Taking the premise that this is a bug with Spork, how would you propose to fix it?
from spork.
Not sure - this is why I was asking your advice ;)
As far as I'm concerned, if it isn't a bug in Spork, it's (one of many) gross aspects of rails.
I'm up for moving my code into a module.
from spork.
I was trying to understand how you arrived at the conclusion that this is a bug in sport.
I would lean towards this being that rails wasn't intended to be used the way spork is using it, so spork has to do some forceful operations to get it to behave. As such, a case could be made that rails has an underlying design flaw.
from spork.
I originally called it a bug in spork because an older version of spork worked fine (that one was preloading ApplicationController, which I consider a nuisance more than anything else).
This version of spork won't work at all unless I first factor my code.
from spork.
BTW: What are you imagining for the parameter idea? Something like this:
http://gist.github.com/799ff78d064b48d2cf30
?
from spork.
Here's a patch:
http://github.com/smtlaissezfaire/spork/tree/application_controller_loading
from spork.
I believe that won't work because some parts of the rails code base (and rspec-rails too, I believe) explicitly call "require 'application_controller.rb'". The way spork blocks this is by sticking the path with the blank application_controllers to the front of the lib path, satisfying all attempts to "require 'application_controller.rb'", and then later deliberately requiring the application's ApplicationController before the specs are run.
Tim
from spork.
Yes - I realized that - which is why I didn't remove the application_helper.rb files, etc.
Sorry if that wasn't obvious from the specs
from spork.
closing
from spork.
Related Issues (20)
- save_and_open_page and spork, spork is loosing test suite / output HOT 7
- issue using spork with rails4 HOT 1
- Spork doesn't support custom features/ directory
- spork puts "Done." but didn't finish testing HOT 2
- Is this project still maintained? HOT 2
- With jruby, prefork runs for every test run and makes test slow HOT 3
- Problem with loading file - cannot load such file -- vcr_helper (LoadError)
- Is it possible to tell spork to connect to a DB other than the normal test DB? HOT 1
- No RSpec output HOT 1
- Output has been changed with RSpec 2.99.0.beta1 HOT 3
- Cannot run specific spec (spork runs all specs)
- RSpec + Spork on Win give no output HOT 9
- rails4 rails-observers gem causes observed models to get loaded at startup
- File load times appear to be increasing from when spork was initialized
- rspec-rails 3.0 support? HOT 4
- Cannot run spork with updated Rails4/RSpec3 HOT 6
- Spork / drb shows Connection refused
- spork can't run correctly ,it shows in 'lookup_ring_any' : : RingNotFoundRingNotFound ( RuntimeError() RuntimeError
- warning: assigned but unused variable - method_name_with_spork
- Your Troubleshooting Link is off at Readme
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spork.