Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fake rubygems

  • Loading branch information...
commit 6b92b43b7838368b88337234d1a50f6bf8133ef7 1 parent 7982e11
@mislav authored
Showing with 12 additions and 2 deletions.
  1. +2 −0  script/test_all
  2. +10 −2 spec/fake_rubygems.rb
View
2  script/test_all
@@ -4,7 +4,9 @@ status=0
run_all(){
spec_files="spec"
[[ $DB != "sqlite3" ]] && spec_files="spec/finders/active_record_spec.rb"
+ set -x
rspec -r fake_rubygems $spec_files
+ set +x
}
export PATH="${PWD}/bin:$PATH"
View
12 spec/fake_rubygems.rb
@@ -1,8 +1,16 @@
# Makes the test suite compatible with Bundler standalone mode (used in CI)
# because Active Record uses `gem` for loading adapters.
Kernel.module_eval do
+
+ remove_method :gem if 'method' == defined? gem
+
def gem(*args)
- warn "warning: gem(#{args.map {|o| o.inspect }.join(', ')}) ignored; called from:"
- warn " " << caller[0,5].join("\n ")
+ return if $VERBOSE.nil?
+ $stderr << "warning: gem(#{args.map {|o| o.inspect }.join(', ')}) ignored"
+ $stderr << "; called from:\n " << caller[0,5].join("\n ") if $DEBUG
+ $stderr << "\n"
end
+
+ private :gem
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.