Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing Gem.available? warning

  • Loading branch information...
commit 7e2b57170f3c38dd877b13dc96c5f933b4bdc044 1 parent e18490b
@jdeff jdeff authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/test_helper.rb
View
8 test/test_helper.rb
@@ -1,4 +1,10 @@
-if defined?(Gem) and Gem.available?('redgreen')
+if begin
+ Gem::Specification::find_by_name 'redgreen'
+ rescue Gem::LoadError
+ false
+ rescue
+ Gem.available? 'redgreen'
+ end
require 'redgreen' if RUBY_VERSION < "1.9"
end
require 'test/unit'
Please sign in to comment.
Something went wrong with that request. Please try again.