rspec-sleeping_king_studios 2.0.0.beta.1 → 2.0.0.beta.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ac96e7fae3fdf94aa39e7ebfecccfc39766ada0
|
4
|
+
data.tar.gz: 0d96c3c2402360bbf600fce1bd882ea38d8f341f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ed09efe3e51e5900e6332fe5e51677c17e47d874aa85304ddad33ab93c12b3f8c5006371e8e80df4efaeeeecdae1fb06fe02bf1a10663df24d7cb7a3b204ed
|
7
|
+
data.tar.gz: 5d4abb850b85fbfffb3544268c4b47b07038816f03e2be7ded0a43ce1bf9963b566ca66db81fa6958eeb491667ac3621ccc8815dbb7807347a8ce2c60793405e
|
@@ -8,7 +8,7 @@ module RSpec::SleepingKingStudios::Matchers::Shared
|
|
8
8
|
# Checks whether the value of the reader matches the expected value. If the
|
9
9
|
# value looks like an RSpec matcher (it responds to :matches?), runs
|
10
10
|
# value.matches?(); otherwise checks for equality using :==.
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# @return [Boolean] true if the value matches the expected value; otherwise
|
13
13
|
# false.
|
14
14
|
def matches_reader_value?
|
@@ -17,13 +17,13 @@ module RSpec::SleepingKingStudios::Matchers::Shared
|
|
17
17
|
|
18
18
|
actual_value = @actual.send(@expected)
|
19
19
|
|
20
|
-
@matches_reader_value = @value.respond_to?(:matches?) ?
|
20
|
+
@matches_reader_value = (@value.respond_to?(:matches?) && @value.respond_to?(:description)) ?
|
21
21
|
@value.matches?(actual_value) :
|
22
22
|
@value == actual_value
|
23
23
|
end # method matches_reader_value?
|
24
24
|
|
25
25
|
# Checks whether the object responds to the reader method :#{property}.
|
26
|
-
#
|
26
|
+
#
|
27
27
|
# @return [Boolean] true if the object responds to the method; otherwise
|
28
28
|
# false.
|
29
29
|
def responds_to_reader?
|
@@ -31,7 +31,7 @@ module RSpec::SleepingKingStudios::Matchers::Shared
|
|
31
31
|
end # method responds_to_reader?
|
32
32
|
|
33
33
|
# Checks whether the object responds to the writer method :#{property}=.
|
34
|
-
#
|
34
|
+
#
|
35
35
|
# @return [Boolean] true if the object responds to the method; otherwise
|
36
36
|
# false.
|
37
37
|
def responds_to_writer?
|
@@ -39,12 +39,12 @@ module RSpec::SleepingKingStudios::Matchers::Shared
|
|
39
39
|
end # method responds_to_reader?
|
40
40
|
|
41
41
|
# Formats the expected value as a human-readable string. If the value looks
|
42
|
-
# like an RSpec matcher (it responds to :matches?), calls
|
42
|
+
# like an RSpec matcher (it responds to :matches? and :description), calls
|
43
43
|
# value#description; otherwise calls value#inspect.
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# @return [String] the value as a human-readable string.
|
46
46
|
def value_to_string
|
47
|
-
return @value.description if @value.respond_to?(:matches?)
|
47
|
+
return @value.description if @value.respond_to?(:matches?) && @value.respond_to?(:description)
|
48
48
|
|
49
49
|
@value.inspect
|
50
50
|
end # method value_to_string
|