File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -75,26 +75,24 @@ def false?
75
75
#
76
76
# Explicitly sets the value to true.
77
77
#
78
- # @return [Boolean] true if the value changed
78
+ # @return [nil]
79
79
def make_true
80
80
@mutex . lock
81
- old = @value
82
81
@value = true
83
82
@mutex . unlock
84
- ! old
83
+ nil
85
84
end
86
85
87
86
# @!macro [attach] atomic_boolean_method_make_false
88
87
#
89
88
# Explicitly sets the value to false.
90
89
#
91
- # @return [Boolean] true if the value changed
90
+ # @return [nil]
92
91
def make_false
93
92
@mutex . lock
94
- old = @value
95
93
@value = false
96
94
@mutex . unlock
97
- old
95
+ nil
98
96
end
99
97
end
100
98
@@ -123,12 +121,12 @@ def value=(value)
123
121
124
122
# @!macro [attach] atomic_boolean_method_is_true
125
123
def true?
126
- @atomic . get == true
124
+ @atomic . get
127
125
end
128
126
129
127
# @!macro [attach] atomic_boolean_method_is_false
130
128
def false?
131
- @atomic . get != true
129
+ ! @atomic . get
132
130
end
133
131
134
132
# @!macro atomic_boolean_method_make_true
Original file line number Diff line number Diff line change 75
75
76
76
describe '#make_true' do
77
77
78
- it 'makes a false value true and returns true ' do
78
+ it 'makes a false value true and returns nil ' do
79
79
subject = described_class . new ( false )
80
- subject . make_true . should be_true
80
+ subject . make_true . should be_nil
81
81
subject . value . should be_true
82
82
end
83
83
84
- it 'keeps a true value true and returns false ' do
84
+ it 'keeps a true value true and returns nil ' do
85
85
subject = described_class . new ( true )
86
- subject . make_true . should be_false
86
+ subject . make_true . should be_nil
87
87
subject . value . should be_true
88
88
end
89
89
end
90
90
91
91
describe '#make_false' do
92
92
93
- it 'makes a true value false and returns true ' do
93
+ it 'makes a true value false and returns nil ' do
94
94
subject = described_class . new ( true )
95
- subject . make_false . should be_true
95
+ subject . make_false . should be_nil
96
96
subject . value . should be_false
97
97
end
98
98
99
- it 'keeps a false value false and returns false ' do
99
+ it 'keeps a false value false and returns nil ' do
100
100
subject = described_class . new ( false )
101
- subject . make_false . should be_false
101
+ subject . make_false . should be_nil
102
102
subject . value . should be_false
103
103
end
104
104
end
You can’t perform that action at this time.
0 commit comments