I use bundler to create and manage my own Ruby gems. I recently stumble
upon this really weird behaviour. If I just do “rspec spec/*” then
everything is fine. If I “take test_specs”, it complains that Article
(see below) is not a class!
The code itself is at http://dev.keltia.net/projects/news-article/
Thanks for any idea.
1168 [16:43] roberto@roberto-al:HG/news-article> rake --trace test_specs
(in /Volumes/Users/roberto/Src/Perso/HG/news-article)
** Invoke test_specs (first_time)
** Execute test_specs
/Volumes/Users/roberto/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S bundle exec
rspec --format documentation “spec/article_spec.rb”
“spec/spec_helper.rb”
/Volumes/Users/roberto/Src/Perso/HG/news-article/lib/news/article.rb:28:in
<module:News>': Article is not a class (TypeError) from /Volumes/Users/roberto/Src/Perso/HG/news-article/lib/news/article.rb:22:in
<top (required)>’
from
/Volumes/Users/roberto/Src/Perso/HG/news-article/spec/article_spec.rb:5:in
require' from /Volumes/Users/roberto/Src/Perso/HG/news-article/spec/article_spec.rb:5:in
<top (required)>’
from
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/configuration.rb:317:in
load' from /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/configuration.rb:317:in
block in load_spec_files’
from
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/configuration.rb:317:in
map' from /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/configuration.rb:317:in
load_spec_files’
from
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/command_line.rb:18:in
run' from /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/runner.rb:55:in
run_in_process’
from
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/runner.rb:46:in
run' from /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/runner.rb:10:in
block in autorun’
rake aborted!
ruby -S bundle exec rspec --format documentation “spec/article_spec.rb”
“spec/spec_helper.rb” failed
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/rake_task.rb:139:in
rescue in block (2 levels) in initialize' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/rake_task.rb:135:in
block (2 levels) in initialize’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1112:in
verbose' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rspec-core-2.2.0/lib/rspec/core/rake_task.rb:131:in
block in initialize’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in
call' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in
block in execute’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in
each' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in
execute’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597:in
block in invoke_with_call_chain' /Volumes/Users/roberto/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in
mon_synchronize’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_chain' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583:in
invoke’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051:in
invoke_task' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in
block (2 levels) in top_level’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in
each' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in
block in top_level’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001:in
block in run' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in
run' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in
<top (required)>’
/Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in load' /Volumes/Users/roberto/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in
’
Rakefile:
desc “Run basic specs”
RSpec::Core::RakeTask.new(:test_specs) do |t|
t.pattern = ‘spec/**/*.rb’
t.rspec_opts = ‘–format documentation’
t.rcov_opts = %q[–exclude “spec”]
t.rcov = false
end