Note that there are some explanatory texts on larger screens.

plurals
  1. PORspec failing with load_missing_constant when classes live in subdirectories and are subclassed
    primarykey
    data
    text
    <p>I'm having some troubles running a bunch of RSpec tests due to something I suspect is related to autoloading. Here is the error:</p> <pre><code>/usr/share/ruby-rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:490:in `load_missing_constant': Expected /var/lib/jenkins/.../portfolios/base_manage_controller.rb to define Portfolios::BaseManageController (LoadError) from /usr/share/ruby-rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:181:in `block in const_missing' from /usr/share/ruby-rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:179:in `each' from /usr/share/ruby-rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:179:in `const_missing' from /usr/share/ruby-rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing' from /var/lib/jenkins/jobs/.../app/controllers/portfolios/customize_controller.rb:1:in `&lt;top (required)&gt;' </code></pre> <p>Here is the header of the file:</p> <pre><code>class Portfolios::BaseManageController &lt; ApplicationController </code></pre> <p>And it lives in <code>app/controllers/portfolios/base_manage_controller.rb</code></p> <p>And its subclass:</p> <pre><code>class Portfolios::CustomizeController &lt; Portfolios::BaseManageController </code></pre> <p>And it lives in <code>app/controllers/portfolios/customize_controller.rb</code></p> <p>Finally here are a bunch of autoloads:</p> <pre><code>config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/**/"] config.autoload_paths += %W(#{config.root}/app/models/statistics) #Any test/dev specific load paths if not Rails.env.production? config.autoload_paths += %W(#{config.root}/spec/support) config.autoload_paths += %W(#{config.root}/spec/support/builders) config.autoload_paths += %W(#{config.root}/spec/support/modules) config.autoload_paths += %W(#{config.root}/spec/support/utils) end </code></pre> <p>Any help would be much appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload