diff options
Diffstat (limited to 'railties/test/abstract_unit.rb')
-rw-r--r-- | railties/test/abstract_unit.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 4510e6241c..50c427dc64 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -27,8 +27,12 @@ else 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." |