minitest-extra-matchers 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minitest/extra/matchers/subject.rb +35 -29
- data/lib/minitest/extra/matchers/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: d81073409d9ae529fa5452d8cad79833bd1acb2a
|
4
|
+
data.tar.gz: c2ddb9f7d11bbd23b3c4f41ce6d0f2c228f614b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d65d864a571472e5aa500c9808a108091216a244477a3b09a9d2e2b11800844e35e4eaeaeb0bc07a9d316b60ec69d2f8d45fbad8c6ef13d04ffa1bef30730c7
|
7
|
+
data.tar.gz: 7c50051dba215bd94d7cdac9a4964d03cee9ff88b72795bd470aec141bf4568898b9aab9f99aebc2bba7853dd441415881c0c3ab03984c1a0aa67df9a19c1b4f
|
@@ -1,37 +1,43 @@
|
|
1
|
-
module Minitest
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
module Minitest
|
2
|
+
module Extra
|
3
|
+
module Matchers
|
4
|
+
module Subject
|
5
|
+
def self.included(base)
|
6
|
+
base.extend ClassMethods
|
7
|
+
base.class_eval do
|
8
|
+
alias_method :context, :describe
|
9
|
+
end
|
10
|
+
end
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
Minitest::Expectations.methods.grep(/^(must|wont)_/).each do |m|
|
13
|
+
define_method m do |*args, &block|
|
14
|
+
subject.send(m, *args, &block)
|
15
|
+
end
|
16
|
+
end
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
def pending
|
19
|
+
skip('Not yet implemented...')
|
20
|
+
end
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
module ClassMethods
|
23
|
+
def subject(name = nil, &block)
|
24
|
+
if name
|
25
|
+
let(name, &block)
|
26
|
+
let(:subject) { send(name) }
|
27
|
+
else
|
28
|
+
let(:subject, &block)
|
29
|
+
end
|
30
|
+
end
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
+
def its(name, &block)
|
33
|
+
it { subject.send(name).instance_eval(&block) }
|
34
|
+
end
|
32
35
|
|
33
|
-
|
34
|
-
|
36
|
+
def pending
|
37
|
+
it { pending }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
35
41
|
end
|
36
42
|
end
|
37
43
|
end
|