[rspec-devel] [ rspec-Bugs-10534 ] Windows: undefined method `controller_name'
noreply at rubyforge.org
noreply at rubyforge.org
Sun May 6 06:24:18 EDT 2007
Bugs item #10534, was opened at 2007-05-02 19:52
You can respond by visiting:
Submitted By: Larry Kluger (larrykluger)
Assigned to: Nobody (None)
Summary: Windows: undefined method `controller_name'
Running 0.9.1 on windows -- (InstantRails with updated rails and other gems) gives following trace (below).
I have updated to all the latest gems and plugins as of today, May 2, 07.
The exact same svn tree on Linux works fine for rake spec
I think something is not requiring the right modules due to Window's back slashes.
Trace followed by list of installed gems
> rake spec
C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib/spec/dsl/behaviour_eval.rb:95:in `method_missing': undefined method `controller_name' for #<Spec::DSL::EvalModule:0x47b489c> (NoMethodError)
... 14 levels...
Command ruby -I"C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/rspec-0.9.1/lib" "C:/i
ssion_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/controllers/user_assets_
controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_
spec.rb" "spec/models/asset_spec.rb" "spec/models/authenticated_base_spec.rb" "spec/models/user_spec
.rb" "spec/views/assets/edit_rhtml_spec.rb" "spec/views/assets/index_rhtml_spec.rb" "spec/views/asse
ts/new_rhtml_spec.rb" "spec/views/assets/show_rhtml_spec.rb" "spec/views/users/edit_rhtml_spec.rb" "
spec/views/users/index_rhtml_spec.rb" "spec/views/users/new_rhtml_spec.rb" "spec/views/users/show_rh
tml_spec.rb" --options "C:/instant_rails_1.7/InstantRails/rails_apps/am2/config/../spec/spec.opts"
C:\instant_rails_1.7\InstantRails\rails_apps\am2>gem list --local
*** LOCAL GEMS ***
Service layer for easy email delivery and testing.
Web-flow and rendering framework putting the VC in MVC.
Web service support for Action Pack.
Implements the ActiveRecord pattern for ORM.
Support and utility classes used by the Rails framework.
Capistrano is a framework and utility for executing commands in
parallel on multiple remote machines, via SSH. The primary goal is
to simplify and automate the deployment of web applications.
Fix an exploitable bug in CGI multipart parsing which affects Ruby
<= 1.8.5 when multipart boundary attribute contains a non-halting
regular expression string.
Advanced command line parser supporting commands
Graphical interface to the RI documentation, with search engine.
FXRuby is the Ruby binding to the FOX GUI toolkit.
A plugin system based only on rubygems that uses dependencies only
HighLine is a high-level command-line IO library.
a swift, liberal HTML parser with a fantastic library
Log4r is a comprehensive and flexible logging library for Ruby.
A small fast HTTP library and server that runs Rails, Camping, Nitro
and Iowa apps.
Mongrel plugin that provides commands and Capistrano tasks for
managing multiple Mongrel processes.
A win32-native build of the MySQL API module for Ruby.
Needle is a Dependency Injection/Inversion of Control container for
Ruby. It supports both type-2 (setter) and type-3 (constructor)
injection. It takes advantage of the dynamic nature of Ruby to
provide a rich and flexible approach to injecting dependencies.
Net::SFTP is a pure-Ruby implementation of the SFTP client protocol.
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
Piston is a utility that enables merge tracking of remote
Web-application framework with template engine, control-flow layer,
Ruby based make-like utility.
Code coverage analysis tool for Ruby
RMagick is an interface between the Ruby programming language and
the ImageMagick and GraphicsMagick image processing libraries.
rspec (0.9.1, 0.8.2)
RSpec-0.9.1 (r1880) - BDD for Ruby http://rspec.rubyforge.org/
This package provides download sources for remote gem installation
A package for interacting with the Windows clipboard
Extra constants and methods for the Dir class on Windows.
Interface for the MS Windows Event Log.
Extra or redefined methods for the File class on Windows.
A File::Stat class tailored to MS Windows
Adds fork, wait, wait2, waitpid, waitpid2 and a special kill method
An interface to the MS SAPI (Sound API) library.
A package for playing with sound on Windows.
A library giving the Win32 console ANSI escape sequence support.
Windows functions and constants predefined via Win32API
>Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-06 06:24
I think the source of this bug is in rspec_on_rails/lib/spec/rails/extensions/kernel.rb
This is where Spec::Rails tries to guess what kind of spec this is. Perhaps this behaves differently on windows?
Could you investigate this please?
Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-06 06:10
Hint: Spec::Rails mixes in different modules for specs depending on whether it thinks it is a model spec, controller spec, view spec or helper spec.
Your error tells me that the controller mixin wasn't included.
RSpec decides what to mix in by looking at the folder of your spec. If it's under spec/controllers this should happen automatically (and apparently this is buggy on windows).
Just to verify this theory (and work around it until a fix has been committed), you could try to be explicit about it:
describe MyController, :behaviour_type => :controller do
You can respond by visiting:
More information about the rspec-devel