`--> rake test
Coverage report generated for Unit Tests to /home/chris-kun/code/thirsty/coverage. 0 / 0 LOC (0.0%) covered.
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9: stack level too deep (SystemStackError)
rake aborted!
Command failed with status (1): [/usr/bin/ruby -I"lib:test" -I"/usr/lib/rub...]
Tasks: TOP => test
(See full trace by running task with --trace)
我只是不确定如何处理上述问题。我应该从哪里开始寻找问题?
更新: 因此,当我尝试从帮助文件中加载环境以进行单元测试时,错误似乎会触发。 (见https://github.com/thumblemonks/riot/issues/45)
更新: 堆栈跟踪:
`--> bundle exec rake test --trace
** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke test:prepare (first_time)
** Execute test:prepare
** Execute test:units
** Invoke test:functionals (first_time)
** Invoke test:prepare
** Execute test:functionals
** Invoke test:integration (first_time)
** Invoke test:prepare
** Execute test:integration
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:97: warning: already initialized constant Options
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:339: warning: already initialized constant StringMax
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:400: warning: already initialized constant RE_LWS
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:401: warning: already initialized constant RE_TOKEN
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:402: warning: already initialized constant RE_QUOTED_STRING
/usr/lib/ruby/gems/1.9.1/gems/rest-open-uri-1.0.0/lib/rest-open-uri.rb:403: warning: already initialized constant RE_PARAMETERS
Coverage report generated for Unit Tests to /home/chris-kun/code/thirsty/coverage. 0 / 0 LOC (0.0%) covered.
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9: stack level too deep (SystemStackError)
rake aborted!
Command failed with status (1): [/usr/bin/ruby -I"lib:test" -I"/usr/lib/rub...]
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:80:in `ruby'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `ruby'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:99:in `block (2 levels) in define'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:57:in `verbose'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/testtask.rb:98:in `block in define'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/bin/rake:19:in `load'
/usr/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
Tasks: TOP => test
答案 0 :(得分:1)
同样的事发生在我身上。您使用的是代码覆盖工具吗?你把require
放在哪里?它位于测试文件的 第一行 上吗?