summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
blob: 6bf38548c30e3fee1abb9ebc43955f32f7f6c3b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'kernel_ext'
require 'bundler/setup'
require 'minitest/autorun'
require 'celluloid/test'
require 'minitest/pride'
require 'minitest/hell'

require 'nickserver/config'

TESTING = true

class Minitest::Test
  # Add global extensions to the test case class here

  def setup
    Nickserver::Config.load
  end

  def file_content(filename)
    (@file_contents ||= {})[filename] ||= File.read(file_path(filename))
  end

  def file_path(filename)
    "%s/files/%s" % [File.dirname(__FILE__), filename]
  end

  def config
    Nickserver::Config
  end
end