@@ -135,29 +135,29 @@ def many(*args, &block) nil; end
135
135
val . should be_rejected
136
136
end
137
137
138
- it 'defines the method after the first call' do
139
- pending ( 'failing inconsistently' )
140
- expect { subject . async . method ( :echo ) } . to raise_error ( NameError )
141
- subject . async . echo ( :foo )
142
- sleep ( 0.1 )
143
- expect { subject . async . method ( :echo ) } . not_to raise_error
138
+ it 'is aliased as #future' do
139
+ val = subject . future . wait ( 5 )
140
+ val . should be_a Concurrent ::Future
144
141
end
145
142
146
- it 'does not define the method on name/arity exception' do
147
- pending ( 'failing inconsistently' )
148
- expect { subject . async . method ( :bogus ) } . to raise_error ( NameError )
149
- expect { subject . async . bogus } . to raise_error ( NameError )
150
- expect { subject . async . method ( :bogus ) } . to raise_error ( NameError )
151
- end
143
+ context '#method_missing' do
152
144
153
- it 'uses the same mutex as #await' do
154
- subject . await . mutex . should eq subject . async . mutex
155
- end
145
+ it 'defines the method after the first call' do
146
+ expect { subject . async . method ( :echo ) } . to raise_error ( NameError )
147
+ subject . async . echo ( :foo )
148
+ sleep ( 0.1 )
149
+ expect { subject . async . method ( :echo ) } . not_to raise_error
150
+ end
156
151
157
- it 'is aliased as #future' do
158
- val = subject . future . wait ( 5 )
159
- val . should be_a Concurrent ::Future
160
- val . should be_pending
152
+ it 'does not define the method on name/arity exception' do
153
+ expect { subject . async . method ( :bogus ) } . to raise_error ( NameError )
154
+ expect { subject . async . bogus } . to raise_error ( NameError )
155
+ expect { subject . async . method ( :bogus ) } . to raise_error ( NameError )
156
+ end
157
+
158
+ it 'uses the same mutex as #await' do
159
+ subject . await . mutex . should eq subject . async . mutex
160
+ end
161
161
end
162
162
end
163
163
@@ -206,28 +206,28 @@ def many(*args, &block) nil; end
206
206
val . should be_rejected
207
207
end
208
208
209
- it 'defines the method after the first call' do
210
- pending ( 'failing inconsistently' )
211
- expect { subject . await . method ( :echo ) } . to raise_error ( NameError )
212
- subject . await . echo ( :foo )
213
- expect { subject . await . method ( :echo ) } . not_to raise_error
209
+ it 'is aliased as #defer' do
210
+ val = subject . defer . echo ( 5 )
211
+ val . should be_a Concurrent ::IVar
214
212
end
215
213
216
- it 'does not define the method on name/arity exception' do
217
- pending ( 'failing inconsistently' )
218
- expect { subject . await . method ( :bogus ) } . to raise_error ( NameError )
219
- expect { subject . await . bogus } . to raise_error ( NameError )
220
- expect { subject . await . method ( :bogus ) } . to raise_error ( NameError )
221
- end
214
+ context '#method_missing' do
222
215
223
- it 'uses the same mutex as #async' do
224
- subject . await . mutex . should eq subject . async . mutex
225
- end
216
+ it 'defines the method after the first call' do
217
+ expect { subject . await . method ( :echo ) } . to raise_error ( NameError )
218
+ subject . await . echo ( :foo )
219
+ expect { subject . await . method ( :echo ) } . not_to raise_error
220
+ end
226
221
227
- it 'is aliased as #defer' do
228
- val = subject . defer . echo ( 5 )
229
- val . should be_a Concurrent ::IVar
230
- val . should be_fulfilled
222
+ it 'does not define the method on name/arity exception' do
223
+ expect { subject . await . method ( :bogus ) } . to raise_error ( NameError )
224
+ expect { subject . await . bogus } . to raise_error ( NameError )
225
+ expect { subject . await . method ( :bogus ) } . to raise_error ( NameError )
226
+ end
227
+
228
+ it 'uses the same mutex as #async' do
229
+ subject . await . mutex . should eq subject . async . mutex
230
+ end
231
231
end
232
232
end
233
233
end
0 commit comments