use_cases 0.3.0 → 0.3.1

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: 9e37115bbba6763134166d41497c5b1bd75725618cfa81a0cca04dccdeda1590
4
- data.tar.gz: bc732410906c5e053d75bf982561a34c663faafed062f5f6ccac006f4f1f3cee
3
+ metadata.gz: 7b4ebb9b33b42faeacd926b68ad103ec38773f7532f42dc125327adcf247dd13
4
+ data.tar.gz: 0afebb1d549e5990f7fa4d910def09bac3773fcf8b4171742fb6d6f111a745b3
5
5
  SHA512:
6
- metadata.gz: f7a9ff7502bf8b6db76f10a56d68a4d43055ecd54a106c50a37abde3543ba832611deb3561f03dd4a0a65e07642144b51620beede3701cb2f437634f39aab100
7
- data.tar.gz: a170718b5d281df6f761b4c297d6cbb5ecfa0dbf5deb34ac01254dfd21a125898de4cf9935b05d49b73a2699c2007b52fcac1caa2e6c160d66e580307deec83a
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
- "the use case was expected to fail with code #{expected_code} but it returned #{test_subject.failure.first}"
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
- "the use case was expected to fail with #{expected_result.inspect} but it returned #{test_subject.failure.last.inspect}"
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
- "the use case was expected to fail with #{expected_result.inspect} but it returned #{test_subject.failure.inspect}"
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
- "the use case was expected to succeed with #{expected_result.inspect} but it returned #{test_subject.success.inspect}"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UseCases
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_cases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ring Twice