diff options
Diffstat (limited to 'railties/test/abstract_unit.rb')
-rw-r--r-- | railties/test/abstract_unit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index 43736ee7ec..a950fc8b7e 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -18,3 +18,11 @@ if defined?(RAILS_ROOT) else RAILS_ROOT = File.dirname(__FILE__) end + +def uses_gem(gem_name, test_name, version = '> 0') + gem gem_name.to_s, version + require gem_name.to_s + yield +rescue LoadError + $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." +end |