开发者

Gems in plugins often not getting loaded, when running that plugin test

开发者 https://www.devze.com 2023-01-13 05:21 出处:网络
For example in open_id_authentication plugin. Inside folder test/test_helper.rb inside that plugin, it got:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消