トップ «前の日記(2007-07-10) 最新 次の日記(2007-07-24)» 編集

3 日坊主日記


2007-07-18 [長年日記]

_ [Rails] rspec on rails - undefined method fixtures (win32)

script/spec で直接 spec ファイルを実行すると fixtures でこけるという現象に小一時間はまった。

RSpec:
svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_5/rspec
RSpec on Rails:
svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_5/rspec_on_rails
C:\tmp\rbm>ruby script\about
About your application's environment
Ruby version                 1.8.6 (i386-mswin32)
RubyGems version             0.9.2
Rails version                1.2.3
Active Record version        1.15.3
Action Pack version          1.13.3
Action Web Service version   1.2.3
Action Mailer version        1.3.3
Active Support version       1.4.2
Application root             C:/tmp/rbm
Environment                  development
Database adapter             sqlite3
Database schema version      1
C:\tmp\rbm>ruby script\spec spec/models/blog_spec.rb
.

Finished in 0.922 seconds

1 example, 0 failures

C:\tmp\rbm>ruby script\spec spec\models\blog_spec.rb
C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:137:in `method_missing': undefined method `fixtures' for #<Spec::DSL::EvalModule:0x46f8c00> (NoMethodError)
        from ./spec\models\blog_spec.rb:4
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:54:in `class_eval'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:54:in `eval_behaviour'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:31:in `initialize'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour_factory.rb:36:in `new'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/dsl/behaviour_factory.rb:36:in `create'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/extensions/kernel.rb:24:in `describe'
        from ./spec\models\blog_spec.rb:3
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:85:in `load_specs'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `each'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:84:in `load_specs'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:22:in `run'
        from C:/tmp/rbm/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run'
        from script/spec:4

ディレクトリセパレータの問題らしい。Windows め。

[]