Permalink
Browse files

Try to load lib before trying to activate the gem for testing

  • Loading branch information...
1 parent 444ba15 commit 7de5f69cc6bc9a946afd3a0fa0ec785f9fb94fb5 @josh josh committed Oct 5, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 railties/test/abstract_unit.rb
@@ -27,8 +27,12 @@
end
def uses_gem(gem_name, test_name, version = '> 0')
- gem gem_name.to_s, version
- require gem_name.to_s
+ begin
+ require gem_name.to_s
+ rescue LoadError
+ gem gem_name.to_s, version
+ require gem_name.to_s
+ end
yield
rescue LoadError
$stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."

0 comments on commit 7de5f69

Please sign in to comment.