diff options
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index d6eabe5..7fbe400 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -19,7 +19,11 @@ class Minitest::Test end def file_content(filename) - (@file_contents ||= {})[filename] ||= File.read("%s/files/%s" % [File.dirname(__FILE__), filename]) + (@file_contents ||= {})[filename] ||= File.read(file_path(filename)) + end + + def file_path(filename) + "%s/files/%s" % [File.dirname(__FILE__), filename] end def real_network @@ -54,4 +58,11 @@ class Minitest::Test end end + # + # temporarily stubs the config property for the duration of the given block + # + def stub_config(property, value, &block) + Nickserver::Config.stub(property, value, &block) + end + end |