On Sun, Jan 2, 2011 at 11:51 PM, David Chelimsky <dchelim...@gmail.com> wrote:
> On Sun, Jan 2, 2011 at 11:01 PM, Jim Morris <wolfma...@gmail.com> wrote:
>> Ok I re installed rspec-rails 2.4.0 looks like my request specs run,
>> and my model specs run but my
>> controller specs and helper specs do not run, and throw that error.
>>
>> I have that config.around.. in my spec_helper which applies to most
>> request specs but not to the helper specs or controller specs (which
>> use mocks), so that is a difference, the around does NOT run when the
>> helpers or controller specs run, but I don't see how that would cause
>> this error.
>>
>> I removed the rspec-cells gem but that did not do anything to help.
>>
>> So if you were to checkout my project and change the Gemfile to get
>> rspec 2.4.0 then run...
>>
>>  rspec spec/controllers/posts_controller_spec.rb
>>
>> you should get this dump...
>
> The around hook is a red herring too.
>
> This is very odd. I'm not sure what it is yet, but it's something to
> do with the load order of modules. I can't reproduce this in my apps,
> but I can in yours with no problem.
>
> Onward ...

Found it. Will release a bug fix release of rspec-rails shortly.

I don't understand why I hadn't seen it in any of my apps, or in
rspec's own spec suite, but it boils down to the order in which
RSpec::Rails::RailsExampleGroup and
ActionController::TestCase::Behavior are declared.

>
>>
>> [sequel] Setting up the "test" environment:
>> /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> actionpack-3.0.3/lib/action_controller/test_case.rb:10: undefined
>> method `setup' for #<Class:0xa1bda8c> (NoMethodError)
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:52:in `class_eval'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:52:in
>> `append_features'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> actionpack-3.0.3/lib/action_controller/test_case.rb:439:in `include'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> actionpack-3.0.3/lib/action_controller/test_case.rb:439
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:52:in `class_eval'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:52:in
>> `append_features'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:48:in `include'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:48:in `send'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:48:in
>> `append_features'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:48:in `each'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> activesupport-3.0.3/lib/active_support/concern.rb:48:in
>> `append_features'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in `include'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in `send'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in
>> `configure_group'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:369:in `each'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:369:in
>> `configure_group'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/world.rb:35:in `configure_group'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/example_group.rb:153:in `set_it_up'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/example_group.rb:130:in `subclass'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/example_group.rb:118:in `describe'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/extensions/object.rb:6:in `describe'
>>        from /home/morris/work/ruby/rails3/wolfmanblog/spec/
>> controllers/posts_controller_spec.rb:3
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in `load'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
>> `load_spec_files'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in `map'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
>> `load_spec_files'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/command_line.rb:18:in `run'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/runner.rb:55:in `run_in_process'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/runner.rb:46:in `run'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>> rspec-core-2.4.0/lib/rspec/core/runner.rb:10:in `autorun'
>>        from /opt/ruby-enterprise-1.8.7-2010.02/bin/rspec:19
>>
>>
>> On Jan 2, 8:12 pm, Jim Morris <wolfma...@gmail.com> wrote:
>>> Yes I can, the full app is onhttps://github.com/wolfmanjm/wolfmanblog_rails
>>> although I downgraded back to rspec-rails 2.3.1, before I did that my
>>> Gemfile.lock looked like...
>>>
>>> GEM
>>>   remote:http://rubygems.org/
>>>   specs:
>>>     abstract (1.0.0)
>>>     actionmailer (3.0.3)
>>>       actionpack (= 3.0.3)
>>>       mail (~> 2.2.9)
>>>     actionpack (3.0.3)
>>>       activemodel (= 3.0.3)
>>>       activesupport (= 3.0.3)
>>>       builder (~> 2.1.2)
>>>       erubis (~> 2.6.6)
>>>       i18n (~> 0.4)
>>>       rack (~> 1.2.1)
>>>       rack-mount (~> 0.6.13)
>>>       rack-test (~> 0.5.6)
>>>       tzinfo (~> 0.3.23)
>>>     activemodel (3.0.3)
>>>       activesupport (= 3.0.3)
>>>       builder (~> 2.1.2)
>>>       i18n (~> 0.4)
>>>     activerecord (3.0.3)
>>>       activemodel (= 3.0.3)
>>>       activesupport (= 3.0.3)
>>>       arel (~> 2.0.2)
>>>       tzinfo (~> 0.3.23)
>>>     activeresource (3.0.3)
>>>       activemodel (= 3.0.3)
>>>       activesupport (= 3.0.3)
>>>     activesupport (3.0.3)
>>>     arel (2.0.6)
>>>     builder (2.1.2)
>>>     cells (3.4.2)
>>>     diff-lcs (1.1.2)
>>>     erubis (2.6.6)
>>>       abstract (>= 1.0.0)
>>>     factory_girl (1.3.2)
>>>     factory_girl_rails (1.0)
>>>       factory_girl (~> 1.3)
>>>       rails (>= 3.0.0.beta4)
>>>     haml (3.0.24)
>>>     i18n (0.5.0)
>>>     mail (2.2.12)
>>>       activesupport (>= 2.3.6)
>>>       i18n (>= 0.4.0)
>>>       mime-types (~> 1.16)
>>>       treetop (~> 1.4.8)
>>>     mime-types (1.16)
>>>     nokogiri (1.4.4)
>>>     pg (0.10.0)
>>>     polyglot (0.3.1)
>>>     rack (1.2.1)
>>>     rack-mount (0.6.13)
>>>       rack (>= 1.0.0)
>>>     rack-test (0.5.7)
>>>       rack (>= 1.0)
>>>     rails (3.0.3)
>>>       actionmailer (= 3.0.3)
>>>       actionpack (= 3.0.3)
>>>       activerecord (= 3.0.3)
>>>       activeresource (= 3.0.3)
>>>       activesupport (= 3.0.3)
>>>       bundler (~> 1.0)
>>>       railties (= 3.0.3)
>>>     railties (3.0.3)
>>>       actionpack (= 3.0.3)
>>>       activesupport (= 3.0.3)
>>>       rake (>= 0.8.7)
>>>       thor (~> 0.14.4)
>>>     rake (0.8.7)
>>>     rdiscount (1.6.5)
>>>     rspec (2.4.0)
>>>       rspec-core (~> 2.4.0)
>>>       rspec-expectations (~> 2.4.0)
>>>       rspec-mocks (~> 2.4.0)
>>>     rspec-cells (0.0.2)
>>>       cells (~> 3.4)
>>>       rails (~> 3.0)
>>>       rspec-rails (~> 2.2)
>>>     rspec-core (2.4.0)
>>>     rspec-expectations (2.4.0)
>>>       diff-lcs (~> 1.1.2)
>>>     rspec-mocks (2.4.0)
>>>     rspec-rails (2.4.0)
>>>       actionpack (~> 3.0)
>>>       activesupport (~> 3.0)
>>>       railties (~> 3.0)
>>>       rspec (~> 2.4.0)
>>>     sequel (3.17.0)
>>>     sequel-rails (0.1.8)
>>>       actionpack (~> 3.0.0)
>>>       activesupport (~> 3.0.0)
>>>       railties (~> 3.0.0)
>>>       sequel (~> 3.13)
>>>     stringex (1.2.0)
>>>     thor (0.14.6)
>>>     treetop (1.4.9)
>>>       polyglot (>= 0.3.1)
>>>     tzinfo (0.3.23)
>>>     uuidtools (2.1.1)
>>>     webrat (0.7.2)
>>>       nokogiri (>= 1.2.0)
>>>       rack (>= 1.0)
>>>       rack-test (>= 0.5.3)
>>>
>>> PLATFORMS
>>>   ruby
>>>
>>> DEPENDENCIES
>>>   cells
>>>   factory_girl_rails
>>>   haml
>>>   pg
>>>   rails (= 3.0.3)
>>>   rdiscount
>>>   rspec-cells
>>>   rspec-rails (~> 2.3)
>>>   sequel-rails
>>>   stringex
>>>   uuidtools
>>>   webrat
>>>
>>> Using rake (0.8.7)
>>> Using abstract (1.0.0)
>>> Using activesupport (3.0.3)
>>> Using builder (2.1.2)
>>> Using i18n (0.5.0)
>>> Using activemodel (3.0.3)
>>> Using erubis (2.6.6)
>>> Using rack (1.2.1)
>>> Using rack-mount (0.6.13)
>>> Using rack-test (0.5.7)
>>> Using tzinfo (0.3.23)
>>> Using actionpack (3.0.3)
>>> Using mime-types (1.16)
>>> Using polyglot (0.3.1)
>>> Using treetop (1.4.9)
>>> Using mail (2.2.12)
>>> Using actionmailer (3.0.3)
>>> Using arel (2.0.6)
>>> Using activerecord (3.0.3)
>>> Using activeresource (3.0.3)
>>> Using bundler (1.0.3)
>>> Using cells (3.4.2)
>>> Using diff-lcs (1.1.2)
>>> Using factory_girl (1.3.2)
>>> Using thor (0.14.6)
>>> Using railties (3.0.3)
>>> Using rails (3.0.3)
>>> Using factory_girl_rails (1.0)
>>> Using haml (3.0.24)
>>> Using nokogiri (1.4.4)
>>> Using pg (0.10.0)
>>> Using rdiscount (1.6.5)
>>> Using rspec-core (2.4.0)
>>> Using rspec-expectations (2.4.0)
>>> Using rspec-mocks (2.4.0)
>>> Using rspec (2.4.0)
>>> Using rspec-rails (2.4.0)
>>> Using rspec-cells (0.0.2)
>>> Using sequel (3.17.0)
>>> Using sequel-rails (0.1.8)
>>> Using stringex (1.2.0)
>>> Using uuidtools (2.1.1)
>>> Using webrat (0.7.2)
>>>
>>> and spec_helper.rb looked like...
>>>
>>> # This file is copied to spec/ when you run 'rails generate
>>> rspec:install'
>>> ENV["RAILS_ENV"] ||= 'test'
>>> require File.expand_path("../../config/environment", __FILE__)
>>> require 'rspec/rails'
>>>
>>> # Requires supporting ruby files with custom matchers and macros, etc,
>>> # in spec/support/ and its subdirectories.
>>> Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
>>>
>>> RSpec.configure do |config|
>>>   # == Mock Framework
>>>   #
>>>   # If you prefer to use mocha, flexmock or RR, uncomment the
>>> appropriate line:
>>>   #
>>>   # config.mock_with :mocha
>>>   # config.mock_with :flexmock
>>>   # config.mock_with :rr
>>>   config.mock_with :rspec
>>>
>>>   # setup transactional factory for sequel, when running transactional
>>> tests
>>>   config.around(:each, :transactional => true) do |example|
>>>     Sequel::DATABASES.first.transaction do
>>>       example.run
>>>       raise Sequel::Error::Rollback
>>>     end
>>>   end
>>>
>>> end
>>>
>>> # to make factory girl run with sequel
>>> class Sequel::Model
>>>   def save!
>>>     save(:validate=>false)
>>>   end
>>> end
>>>
>>> On Jan 2, 7:46 pm, David Chelimsky <dchelim...@gmail.com> wrote:
>>>
>>> > On Sun, Jan 2, 2011 at 9:09 PM, Jim Morris <wolfma...@gmail.com> wrote:
>>> > > I just upgraded from 2.3.1 and I now get this error on all my specs...
>>> > > Nothing else changed and the Upgrade.md does not indicate any backward
>>> > > compatibilities unless I missed something.
>>>
>>> > > (in /home/morris/work/ruby/rails3/wolfmanblog)
>>> > > /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby -S bundle exec rspec ./
>>> > > spec/controllers/posts_controller_spec.rb
>>> > > [sequel] Setting up the "test" environment:
>>> > > /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > actionpack-3.0.3/lib/action_controller/test_case.rb:10: undefined
>>> > > method `setup' for #<Class:0xa24723c> (NoMethodError)
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:52:in `class_eval'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:52:in
>>> > > `append_features'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > actionpack-3.0.3/lib/action_controller/test_case.rb:439:in `include'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > actionpack-3.0.3/lib/action_controller/test_case.rb:439
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:52:in `class_eval'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:52:in
>>> > > `append_features'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:48:in `include'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:48:in `send'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:48:in
>>> > > `append_features'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:48:in `each'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > activesupport-3.0.3/lib/active_support/concern.rb:48:in
>>> > > `append_features'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in `include'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in `send'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:372:in
>>> > > `configure_group'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:369:in `each'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:369:in
>>> > > `configure_group'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/world.rb:35:in `configure_group'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/example_group.rb:153:in `set_it_up'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/example_group.rb:130:in `subclass'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/example_group.rb:118:in `describe'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/extensions/object.rb:6:in `describe'
>>> > >        from /home/morris/work/ruby/rails3/wolfmanblog/spec/
>>> > > controllers/posts_controller_spec.rb:3
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in `load'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
>>> > > `load_spec_files'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in `map'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/configuration.rb:387:in
>>> > > `load_spec_files'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/command_line.rb:18:in `run'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/runner.rb:55:in `run_in_process'
>>> > >        from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/
>>> > > rspec-core-2.4.0/lib/rspec/core/runner.rb:46:in `run'
>>> > >        from
>>>
>>> ...
>>>
>>> read more »
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to