summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
blob: 1d48c638cb7d347e4d6ce4570affbd3764dac436 (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
$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 '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)
    format('%s/files/%s', File.dirname(__FILE__), filename)
  end

  def config
    Nickserver::Config
  end
end