mark
November 9, 2007, 1:56am
1
I have a project on edge rails that I’m trying to convert from Test:Unit
to rspec. I have the rspec gem version 2338, the rspec and
rsepc_on_rails version 2831 in vendor/plugins, and rails version 8117 in
vendor/rails.
I’ve been able to get a few specs passing, have gotten the specs running
from autotest, and am able to do “rake spec:doc” and get the basic
command line spec printout. I’d like be able to generate the html spec
printout, so I tried “spec spec --format html” but got the “undefined
method `before’ for Spec::Rails::DSL::RailsExample:Class
(NoMethodError)” mentioned in the “Autotest busted with Rspec/Rails
trunk” thread from this forum.
I was wondering if anyone else has been able to get the spec printouts
working with edge rails and if so what versions of
rails/rspec/rspec_on_rails were used.
Thanks for your help,
mark
November 9, 2007, 2:07am
2
I can’t get rspec to work with rails edge either, when I do
“rake db:migrate RAILS_ENV=test”
I get:
undefined method failure_message' for class
Spec::Matchers::Have’
So I can’t even start working on my project It works without rspec.
mark
November 9, 2007, 2:29am
3
On Nov 8, 2007 7:06 PM, Patrick A. [email protected] wrote:
I can’t get rspec to work with rails edge either, when I do
“rake db:migrate RAILS_ENV=test”
I get:
undefined method failure_message' for class
Spec::Matchers::Have’
That was due to a change in edge rails 8115, which broke rspec. It is
now fixed - just update rspec to the current trunk.
mark
November 9, 2007, 2:39am
4
Ive just svn up and I still get the same error.
mark
November 9, 2007, 2:50am
5
On Nov 8, 2007 7:38 PM, Patrick A. [email protected] wrote:
Ive just svn up and I still get the same error.
I don’t know what to tell you - I just blew away vendor/rails,
vendor/plugins/rspec and vendor/plugins/rspec_on_rails, reinstalled
all three from their respective trunks and all is well.
The problem was being caused by two files in the same location on the
path:
vendor/plugins/rspec/lib/spec/matchers/have.rb
vendor/plugins/rspec_on_rails/lib/spec/matchers/have.rb
The were both being seen as spec/matchers/have.rb.
I moved the one in rspec_on_rails to a different location. Any chance
the old one is still sitting around?
mark
November 9, 2007, 2:52am
6
Patrick A. wrote:
Ive just svn up and I still get the same error.
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users
Did you svn up rspec_on_rails as well?
mark
November 9, 2007, 3:05am
7
On Nov 8, 2007 7:58 PM, Patrick A. [email protected] wrote:
I did rm -rf both and now I get this:
superclass mismatch for class TestResponse
Can you provide a tiny bit more context than that? What command are
you using? Stack trace?
mark
November 9, 2007, 2:59am
8
I did rm -rf both and now I get this:
superclass mismatch for class TestResponse
mark
November 9, 2007, 3:08am
9
sorry:
rake db:migrate RAILS_ENV=test --trace
(in /home/pat/catalogr)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
superclass mismatch for class TestResponse
/home/pat/catalogr/vendor/rails/actionpack/lib/action_controller/test_process.rb:286
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' /home/pat/catalogr/vendor/plugins/rspec_on_rails/lib/spec/rails.rb:5 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:104:in
require_or_load' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:248:in
load_missing_constant’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:453:in
const_missing' /home/pat/catalogr/vendor/plugins/rspec_on_rails/lib/spec/extensions/action_view/base.rb:3 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/plugins/rspec_on_rails/lib/spec/extensions.rb:10
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:496:in
require' /home/pat/catalogr/vendor/plugins/rspec/lib/spec.rb:7 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' /home/pat/catalogr/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:496:in
require’
/home/pat/catalogr/vendor/plugins/rspec/init.rb:2:in evaluate_init_rb' /home/pat/catalogr/config/../vendor/rails/railties/lib/rails/plugin.rb:79:in
evaluate_init_rb’
/home/pat/catalogr/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in
silence_warnings' /home/pat/catalogr/config/../vendor/rails/railties/lib/rails/plugin.rb:75:in
evaluate_init_rb’
/home/pat/catalogr/config/…/vendor/rails/railties/lib/rails/plugin.rb:39:in
load' /home/pat/catalogr/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:33:in
load_plugins’
/home/pat/catalogr/config/…/vendor/rails/railties/lib/rails/plugin/loader.rb:32:in
each' /home/pat/catalogr/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:32:in
load_plugins’
/home/pat/catalogr/config/…/vendor/rails/railties/lib/initializer.rb:189:in
load_plugins' /home/pat/catalogr/config/../vendor/rails/railties/lib/initializer.rb:105:in
process’
/home/pat/catalogr/config/…/vendor/rails/railties/lib/initializer.rb:49:in
send' /home/pat/catalogr/config/../vendor/rails/railties/lib/initializer.rb:49:in
run’
/home/pat/catalogr/config/environment.rb:13
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
require’
/home/pat/catalogr/vendor/rails/railties/lib/tasks/misc.rake:3
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in
execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in
synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in
invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in
send’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in
invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in
synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in
top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in
load’
/usr/bin/rake:16
mark
November 9, 2007, 3:14am
10
On Nov 8, 2007 8:07 PM, Patrick A. [email protected] wrote:
sorry:
rake db:migrate RAILS_ENV=test --trace
(in /home/pat/catalogr)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
superclass mismatch for class TestResponse
/home/pat/catalogr/vendor/rails/actionpack/lib/action_controller/test_process.rb:286
That line reads like this:
class TestResponse < AbstractResponse
So it seems like there’s some other loading problem. Try and blow away
the rspec plugins and run this migration and see if you still have
trouble.
mark
November 9, 2007, 3:18am
11
if I nuke the plugin i works:
rake db:migrate RAILS_ENV=test
(in /home/pat/catalogr)
== 2 CreateBrands: migrating
– create_table(:brands)
-> 0.2779s
== 2 CreateBrands: migrated (0.2782s)
mark
November 9, 2007, 3:20am
12
On Nov 8, 2007 8:18 PM, Patrick A. [email protected] wrote:
if I nuke the plugin i works:
rake db:migrate RAILS_ENV=test
(in /home/pat/catalogr)
== 2 CreateBrands: migrating ==================================================
– create_table(:brands)
→ 0.2779s
== 2 CreateBrands: migrated (0.2782s) =========================================
That’s hosed!!!
What other plugins do you have installed?
mark
November 9, 2007, 3:36am
13
On Nov 8, 2007 8:21 PM, Patrick A. [email protected] wrote:
Nothing its a fresh project with latest rails edge that i started to
learn rspec.
Rails edge or 2.0 preview?
mark
November 9, 2007, 3:22am
14
Nothing its a fresh project with latest rails edge that i started to
learn rspec.
mark
November 9, 2007, 3:48am
16
ok works great maybe because I did the scaffold with an old version
rspec? (the one from this morning), sounds weird though. anyway,
Thanks a lot!
mark
November 9, 2007, 3:41am
17
On Nov 8, 2007 8:36 PM, David C. [email protected] wrote:
On Nov 8, 2007 8:21 PM, Patrick A. [email protected] wrote:
Nothing its a fresh project with latest rails edge that i started to
learn rspec.
Rails edge or 2.0 preview?
I just did this:
rails foo
cd foo
rake rails:freeze:edge
ruby script/plugin install svn://rubyforge.org/var/svn/rspec/trunk/rspec
ruby script/plugin install
svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails
script/generate rspec
rake db:create:all
script/generate rspec_scaffold Thing name:string
rake db:migrate
rake spec
All ran perfectly well. I really don’t know what’s going on on your
machine.
mark
November 9, 2007, 4:03pm
18
On Nov 9, 2007 3:40 AM, David C. [email protected] wrote:
rake spec
All ran perfectly well. I really don’t know what’s going on on your machine.
but did you try to run ‘rake db:migrate RAILS_ENV=test’ in your foo
app? doesn’t work here.
mark
November 9, 2007, 4:06pm
19
On Nov 9, 2007 9:02 AM, Patrick A. [email protected] wrote:
rake db:migrate
rake spec
All ran perfectly well. I really don’t know what’s going on on your machine.
but did you try to run ‘rake db:migrate RAILS_ENV=test’ in your foo
app? doesn’t work here.
Ah - why are you doing that? rake spec takes care of setting up your
test db.
mark
November 14, 2007, 7:28pm
20
David C. wrote:
On Nov 8, 2007 8:36 PM, David C. [email protected] wrote:
On Nov 8, 2007 8:21 PM, Patrick A. [email protected] wrote:
Nothing its a fresh project with latest rails edge that i started to
learn rspec.
Rails edge or 2.0 preview?
I just did this:
rails foo
cd foo
rake rails:freeze:edge
ruby script/plugin install svn://rubyforge.org/var/svn/rspec/trunk/rspec
ruby script/plugin install
svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails
script/generate rspec
rake db:create:all
script/generate rspec_scaffold Thing name:string
rake db:migrate
rake spec
All ran perfectly well. I really don’t know what’s going on on your
machine.
Installing plugin from the url you provided fixed the issue. I had
“undefined method `failure_message’” problem with plugin installed today
from this url:
svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec_on_rails