For example in open_id_authentication plugin. Inside folder test/test_helper.rb inside that plugin, it got:
require 'test/unit'
require 'rubygems'
gem 'activesupport'
require 'active_support'
gem 'actionpack'
require 'action_controller'
gem 'mocha-0.9.8'
require 'mocha'
gem 'ruby-openid'
require 'openid'
RAILS_ROOT = File.dirname(__FILE__) unless defined? RAILS_ROOT
require File.dirname(__FILE__) + "/../lib/open_id_authentication"
But whenever I run the test (both by ctrl + R in TextMate or ruby open_id_authentication.rb -v in Terminal, it returned Gem::LoadError: Could not fin开发者_如何学God RubyGem mocha-0.9.8 (>= 0)
I have installed mocha gem by running both in terminal, just to made sure:
gem install mocha
sudo gem install mocha
And I even added this line in config/environment.rb
config.gem 'mocha'
so what should I do now?
Not sure about textmate but your call should be
ruby -Itest open_id_authentication.rb
to include the test dir with your test helper file.
Try and run the following command:
sudo bundle install moca
精彩评论