minitest-filesystem 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/README.md +4 -0
- data/lib/minitest/filesystem/matcher.rb +10 -10
- data/lib/minitest/filesystem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5edb0d40a8fe405e13d768d35eebcd0a42ebdfad
|
4
|
+
data.tar.gz: 8659eb65331a821a571ef3aa458fa20f639622b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24258a794d7def3488c1b13d8c298fe4937f74de30fb048165f5b069b16738e3ae7f59b1947d6808ca1199fc5862822091bbdeaedcb592f5d9710a7bc6928de1
|
7
|
+
data.tar.gz: f06f66341d1ff128c1f4eb532e4019902c8dd577eaeadea944759cbcb182399700c286f8ccbd1a4279b149429446e6da8a59c22003027eeb05004af0c9b2164e
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -10,13 +10,13 @@ module MiniTest
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def file(file)
|
13
|
-
entry(
|
13
|
+
entry(file, :file) && is_a?(file, :file)
|
14
14
|
end
|
15
15
|
|
16
16
|
def dir(dir, &block)
|
17
17
|
matcher = self.class.new(@actual_tree.expand_path(dir), &block) if block_given?
|
18
18
|
|
19
|
-
entry(:directory
|
19
|
+
entry(dir, :directory) && is_a?(dir, :directory) && subtree(matcher)
|
20
20
|
end
|
21
21
|
|
22
22
|
def match_found?
|
@@ -30,20 +30,20 @@ module MiniTest
|
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
def entry(
|
33
|
+
def entry(entry, kind=:entry)
|
34
34
|
update_matching_status(
|
35
35
|
@actual_tree.include?(entry),
|
36
|
-
not_found_msg_for(
|
36
|
+
not_found_msg_for(entry, kind))
|
37
37
|
end
|
38
38
|
|
39
39
|
def subtree(matcher)
|
40
40
|
update_matching_status(matcher.match_found?, matcher.message) if matcher
|
41
41
|
end
|
42
42
|
|
43
|
-
def is_a?(
|
43
|
+
def is_a?(entry, kind)
|
44
44
|
update_matching_status(
|
45
|
-
@actual_tree.is_a?(
|
46
|
-
mismatch_msg_for(
|
45
|
+
@actual_tree.is_a?(entry, kind),
|
46
|
+
mismatch_msg_for(entry, kind))
|
47
47
|
end
|
48
48
|
|
49
49
|
def update_matching_status(check, msg)
|
@@ -53,11 +53,11 @@ module MiniTest
|
|
53
53
|
@is_matching
|
54
54
|
end
|
55
55
|
|
56
|
-
def not_found_msg_for(
|
56
|
+
def not_found_msg_for(entry, kind)
|
57
57
|
"Expected `#{@actual_tree.root}` to contain #{kind} `#{entry}`."
|
58
58
|
end
|
59
59
|
|
60
|
-
def mismatch_msg_for(
|
60
|
+
def mismatch_msg_for(entry, kind)
|
61
61
|
"Expected `#{entry}` to be a #{kind}, but it was not."
|
62
62
|
end
|
63
63
|
|
@@ -77,7 +77,7 @@ module MiniTest
|
|
77
77
|
@tree.include?(expand_path(entry))
|
78
78
|
end
|
79
79
|
|
80
|
-
def is_a?(
|
80
|
+
def is_a?(entry, kind)
|
81
81
|
(expand_path entry).send("#{kind}?")
|
82
82
|
end
|
83
83
|
|