@@ -16,15 +16,24 @@ def initialize(actual)
16
16
end
17
17
18
18
def ==( expected )
19
- method_missing ( :== , expected )
19
+ result = @actual == expected
20
+ unless result
21
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :== , expected , result , "to be truthy" )
22
+ end
20
23
end
21
24
22
25
def !=( expected )
23
- method_missing ( :!= , expected )
26
+ result = @actual != expected
27
+ unless result
28
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :!= , expected , result , "to be truthy" )
29
+ end
24
30
end
25
31
26
32
def equal? ( expected )
27
- method_missing ( :equal? , expected )
33
+ result = @actual . equal? ( expected )
34
+ unless result
35
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :equal? , expected , result , "to be truthy" )
36
+ end
28
37
end
29
38
30
39
def method_missing ( name , *args , &block )
@@ -41,15 +50,24 @@ def initialize(actual)
41
50
end
42
51
43
52
def ==( expected )
44
- method_missing ( :== , expected )
53
+ result = @actual == expected
54
+ if result
55
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :== , expected , result , "to be falsy" )
56
+ end
45
57
end
46
58
47
59
def !=( expected )
48
- method_missing ( :!= , expected )
60
+ result = @actual != expected
61
+ if result
62
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :!= , expected , result , "to be falsy" )
63
+ end
49
64
end
50
65
51
66
def equal? ( expected )
52
- method_missing ( :equal? , expected )
67
+ result = @actual . equal? ( expected )
68
+ if result
69
+ ::SpecExpectation . fail_single_arg_predicate ( @actual , :equal? , expected , result , "to be falsy" )
70
+ end
53
71
end
54
72
55
73
def method_missing ( name , *args , &block )
0 commit comments