ex_aequo_rspex 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceded2826c2e982fde7850551853a07acebe5508d18b85b4d8aaf6436a32a99b
|
4
|
+
data.tar.gz: 478e016712575d845fb04b5bd76b01a630ed08b019688d069f9945292fbb8115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dab66505fc413238f36662612c92f630831f5f7ac9badc4f7525ce32068a9aa4f4bad2a76796c6c5e57f31fa091f8d9e99460bcbb6570ea12c2242cfb1982e0
|
7
|
+
data.tar.gz: 2fe4205f1fd1aa99aa61938d70e4b0d93abc4c65766beee19fc025ff61ffedc45139cfc64d8de3e0d59f2c597dd003dd08a22290d39e287295e8c8277f9ec32a
|
@@ -30,6 +30,20 @@ module ExAequo
|
|
30
30
|
expect(actual).to be_between(lower, higher)
|
31
31
|
end
|
32
32
|
|
33
|
+
def it_is_false(&blk) = it_equals(false, &blk)
|
34
|
+
|
35
|
+
def it_is_falsy(&blk)
|
36
|
+
actual = blk ? instance_eval(&blk) : subject
|
37
|
+
expect(actual).to be_falsy
|
38
|
+
end
|
39
|
+
|
40
|
+
def it_is_true(&blk) = it_equals(true, &blk)
|
41
|
+
|
42
|
+
def it_is_truthy(&blk)
|
43
|
+
actual = blk ? instance_eval(&blk) : subject
|
44
|
+
expect(actual).to be_truthy
|
45
|
+
end
|
46
|
+
|
33
47
|
def it_is_not(predicate, *args, &blk)
|
34
48
|
actual = blk ? instance_eval(&blk) : subject
|
35
49
|
expect(actual).not_to send("be_#{predicate}", *args)
|
@@ -44,6 +58,13 @@ module ExAequo
|
|
44
58
|
expect { blk ? instance_eval(&blk) : subject }
|
45
59
|
.to raise_error(exception, message)
|
46
60
|
end
|
61
|
+
|
62
|
+
def it_puts(lines, to: $stdout, &blk)
|
63
|
+
lines.each do
|
64
|
+
expect(to).to receive(:puts).with(it).ordered
|
65
|
+
end
|
66
|
+
blk ? instance_eval(&blk) : subject
|
67
|
+
end
|
47
68
|
end
|
48
69
|
end
|
49
70
|
end
|
@@ -5,16 +5,16 @@ module ExAequo
|
|
5
5
|
module Macros
|
6
6
|
module SubjectMacros
|
7
7
|
|
8
|
-
def it_eq(value, &blk)
|
9
|
-
specify do
|
8
|
+
def it_eq(value, name: nil, &blk)
|
9
|
+
specify name do
|
10
10
|
it_eq(value, &blk)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
alias_method :it_equals, :it_eq
|
14
14
|
|
15
|
-
def it_fails_spec(message=nil, &blk)
|
16
|
-
specify do
|
17
|
-
it_raises(
|
15
|
+
def it_fails_spec(message=nil, with: RSpec::Expectations::ExpectationNotMetError, &blk)
|
16
|
+
specify name do
|
17
|
+
it_raises(with, message, &blk)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -36,23 +36,43 @@ module ExAequo
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def it_is_false(name: nil, &blk) = it_eq(false, name:, &blk)
|
40
|
+
def it_is_falsy(name: nil, &blk)
|
41
|
+
specify name do
|
42
|
+
it_is_falsy(&blk)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
39
46
|
def it_is_not(predicate, *args, &blk)
|
40
47
|
specify do
|
41
48
|
it_is_not(predicate, *args, &blk)
|
42
49
|
end
|
43
50
|
end
|
44
51
|
|
52
|
+
def it_is_true(name: nil, &blk) = it_eq(true, name:, &blk)
|
53
|
+
def it_is_truthy(name: nil, &blk)
|
54
|
+
specify name do
|
55
|
+
it_is_truthy(&blk)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
45
59
|
def it_matches(matcher, name: nil, &blk)
|
46
60
|
specify name do
|
47
61
|
it_matches(matcher, &blk)
|
48
62
|
end
|
49
63
|
end
|
50
64
|
|
51
|
-
def it_raises(exception, message=nil, &blk)
|
52
|
-
specify do
|
65
|
+
def it_raises(exception, message=nil, name: nil, &blk)
|
66
|
+
specify name do
|
53
67
|
it_raises(exception, message, &blk)
|
54
68
|
end
|
55
69
|
end
|
70
|
+
|
71
|
+
def it_puts(lines, to: $stdout, name: nil, &blk)
|
72
|
+
specify name do
|
73
|
+
it_puts(lines, to:, &blk)
|
74
|
+
end
|
75
|
+
end
|
56
76
|
end
|
57
77
|
end
|
58
78
|
end
|