blob: e2a1f7422795fff030791ac138197f329277765f (
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
34
35
36
37
38
39
40
41
|
# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__)+'/../helper')
# require File.expand_path(File.dirname(__FILE__) + '/../miquire')
# require File.expand_path(File.dirname(__FILE__) + '/../lib/test_unit_extensions')
$debug = true
$logfile = nil
$daemon = false
Dir::chdir File.dirname(__FILE__) + '/../core'
class TC_Miquire < Test::Unit::TestCase
def setup
end
must "miquire lib" do
Miquire.stubs(:miquire_original_require).with('library').returns(true).once
miquire :lib, 'library'
end
must "miquire normal" do
Miquire.stubs(:miquire_original_require).with('normal/normal_file').returns(true).once
miquire :normal, 'normal_file'
end
must "miquire allfiles" do
files = stub()
files.stubs(:select).returns(["file1", "file2", "file3"])
Dir.stubs(:glob).with('allfiles/*').returns(files).once
Miquire.stubs(:miquire_original_require).with('file1').returns(true).once
Miquire.stubs(:miquire_original_require).with('file2').returns(true).once
Miquire.stubs(:miquire_original_require).with('file3').returns(true).once
miquire :allfiles
end
end
|