学习ruby的测试例子:
http://www.sitepoint.com/minitest-shoulda/
代码在这:
https://github.com/JesseHerrick/minitest-with-shoulda
在iterm里面执行成功
➜ minitest-with-shoulda git:(master) ✗ pwd
/Users/qk/mygithub/minitest-with-shoulda
➜ minitest-with-shoulda git:(master) ✗ ruby -I test:lib test/test_calculator_basic.rb
Run options: --seed 21817
....
Finished in 0.002545s, 1571.7092 runs/s, 1571.7092 assertions/s.
4 runs, 4 assertions, 0 failures, 0 errors, 0 skips
/Users/qk/.rvm/rubies/ruby-2.0.0-p481/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/qk/mygithub/minitest-with-shoulda/test/test_calculator_basic.rb
Testing started at 上午10:50 ...
/Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:92:in block in materialize': Could not find ansi-1.4.3 in any of the sources (Bundler::GemNotFound)
map!'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in materialize'
specs'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/definition.rb:133:in
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/definition.rb:178:in specs_for'
requested_specs'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/definition.rb:167:in
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/environment.rb:18:in requested_specs'
setup'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:13:in
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler.rb:120:in setup'
<top (required)>'
from /Users/qk/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/setup.rb:17:in
from /Users/qk/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
require'
from /Users/qk/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
Process finished with exit code 1
请问如何解决呢
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.