Skip to content

Commit

Permalink
Don't pollute the test output
Browse files Browse the repository at this point in the history
  • Loading branch information
morten committed May 11, 2012
1 parent 4f0f863 commit 3679efa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/onelogin/ruby-saml/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Onelogin
module Saml
class Logging
def self.debug(message)
return if !!ENV["ruby-saml/testing"]

if defined? Rails
Rails.logger.debug message
else
Expand All @@ -11,6 +13,8 @@ def self.debug(message)
end

def self.info(message)
return if !!ENV["ruby-saml/testing"]

if defined? Rails
Rails.logger.info message
else
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'ruby-saml'

ENV["ruby-saml/testing"] = "1"

class Test::Unit::TestCase
def fixture(document, base64 = true)
response = Dir.glob(File.join(File.dirname(__FILE__), "responses", "#{document}*")).first
Expand Down

0 comments on commit 3679efa

Please sign in to comment.