File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ def self.execute(opts = {}, &block)
107
107
return Future . new ( opts , &block ) . execute
108
108
end
109
109
110
+ protected :set , :fail , :complete
111
+
110
112
private
111
113
112
114
# @!visibility private
Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ def execute_dereferenceable(subject)
58
58
it_should_behave_like :dereferenceable
59
59
end
60
60
61
+ context 'subclassing' do
62
+
63
+ subject { Future . execute { 42 } }
64
+
65
+ it 'protects #set' do
66
+ expect { subject . set ( 100 ) } . to raise_error
67
+ end
68
+
69
+ it 'protects #fail' do
70
+ expect { subject . fail } . to raise_error
71
+ end
72
+
73
+ it 'protects #complete' do
74
+ expect { subject . complete ( true , 100 , nil ) } . to raise_error
75
+ end
76
+ end
77
+
61
78
context '#initialize' do
62
79
63
80
it 'sets the state to :unscheduled' do
@@ -286,7 +303,6 @@ def reentrant_observer(future)
286
303
obs . value . should eq 42
287
304
end
288
305
end
289
-
290
306
end
291
307
end
292
308
end
You can’t perform that action at this time.
0 commit comments