Sha256: 0463f4cfeccad8f98315190a59196fb3fda042307ded36065d8690bdcca22925

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

require 'simplecov'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  project_name 'rack-blogengine'
  add_filter '/test/'
  add_filter '/pkg/'
  add_filter '/spec/'
  add_filter '/features/'
  add_filter '/doc/'
  add_filter '/assets/'
end if ENV['COVERAGE']

# Previous content of test helper now starts here

# Minitest
require 'minitest/autorun'
require 'minitest/mock'
require 'minitest/pride' # for colored output

# Rack Test Methods
require 'rack/test'

# TestUnit -> MiniTest (TestUnit is only compatibility Layer)
# require 'test/unit'

# Load Rack::Blogengine gem
require 'rack/blogengine'

# class Hash
  # method for usage with assert_boolean
  # -> for failing it needs nil instead of false (which #has_key? returns in failing case)
  # NOT Needed use assert_true instead...
  # def hash_key?(key)
  #   if self.has_key?(key)
  #	    return true
  #	  else
  #	    return nil
  #	  end
  # end
# end

#
# Opening Kernel for testpath method
#
# @author [benny]
#
module Kernel
  def testpath
    "#{Rack::Blogengine.root}/testfolder"
  end
end

def capture_stdout(&block)
  original_stdout = $stdout
  $stdout = fake = StringIO.new
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  fake.string
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rack-blogengine-1.0.7 test/test_helper.rb
rack-blogengine-1.0.6 test/test_helper.rb
rack-blogengine-1.0.5 test/test_helper.rb
rack-blogengine-1.0.4 test/test_helper.rb
rack-blogengine-1.0.3 test/test_helper.rb
rack-blogengine-1.0.2 test/test_helper.rb
rack-blogengine-1.0.1 test/test_helper.rb
rack-blogengine-1.0.0 test/test_helper.rb
rack-blogengine-0.2.7 test/test_helper.rb
rack-blogengine-0.2.6 test/test_helper.rb
rack-blogengine-0.2.5 test/test_helper.rb