use_cases 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/use_cases/rspec/matchers.rb +20 -4
- data/lib/use_cases/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b4ebb9b33b42faeacd926b68ad103ec38773f7532f42dc125327adcf247dd13
|
4
|
+
data.tar.gz: 0afebb1d549e5990f7fa4d910def09bac3773fcf8b4171742fb6d6f111a745b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981827ca7f45383a32c2c015daf559665fe790c4481f02668f460b26e7866a354a6e6a5630d92a20c988d069eece47bdcb62fdb6548731cd19f43c76cd062b23
|
7
|
+
data.tar.gz: e21e32a5c9aae5f8b3b1b0235b85f50385aeaf058cf2c458fcb44b206ba973bc9071e5891d3827c5cc558c1800b3a4c9da697de05125298206f90a2c52c02575
|
@@ -9,7 +9,11 @@ RSpec::Matchers.define(:be_failure_with_code) do |expected_code|
|
|
9
9
|
end
|
10
10
|
|
11
11
|
failure_message do |test_subject|
|
12
|
-
|
12
|
+
if text_subject.failure?
|
13
|
+
"the use case was expected to fail with code #{expected_code} but it returned #{test_subject.failure.first}"
|
14
|
+
else
|
15
|
+
"the use case was expected to fail with code #{expected_code} but it did not fail"
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
@@ -20,7 +24,11 @@ RSpec::Matchers.define(:be_failure_with_payload) do |expected_result|
|
|
20
24
|
end
|
21
25
|
|
22
26
|
failure_message do |test_subject|
|
23
|
-
|
27
|
+
if test_subject.failure?
|
28
|
+
"the use case was expected to fail with #{expected_result.inspect} but it returned #{test_subject.failure.last.inspect}"
|
29
|
+
else
|
30
|
+
"the use case was expected to fail but it succeeded with #{test_subject.success.inspect}"
|
31
|
+
end
|
24
32
|
end
|
25
33
|
end
|
26
34
|
|
@@ -31,7 +39,11 @@ RSpec::Matchers.define(:be_failure_with) do |*expected_failure|
|
|
31
39
|
end
|
32
40
|
|
33
41
|
failure_message do |test_subject|
|
34
|
-
|
42
|
+
if test_subject.failure?
|
43
|
+
"the use case was expected to fail with #{expected_result.inspect} but it returned #{test_subject.failure.inspect}"
|
44
|
+
else
|
45
|
+
"the use case was expected to fail but it succeeded with #{test_subject.success.inspect}"
|
46
|
+
end
|
35
47
|
end
|
36
48
|
end
|
37
49
|
|
@@ -42,6 +54,10 @@ RSpec::Matchers.define(:be_successful_with) do |expected_result|
|
|
42
54
|
end
|
43
55
|
|
44
56
|
failure_message do |test_subject|
|
45
|
-
|
57
|
+
if test_subject.success?
|
58
|
+
"the use case was expected to succeed with #{expected_result.inspect} but it returned #{test_subject.success.inspect}"
|
59
|
+
else
|
60
|
+
"the use case was expected to succeed but it failed with #{test_subject.failure.inspect}"
|
61
|
+
end
|
46
62
|
end
|
47
63
|
end
|
data/lib/use_cases/version.rb
CHANGED