Skip to content

Commit 9d888f7

Browse files
aardvark179eregon
authored andcommitted
Fix linter warnings.
1 parent 972a12f commit 9d888f7

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

spec/truffle/interop/special_forms_spec.rb

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
end
103103

104104
it "raises an argument error if an assignment method is called with more than 1 argument" do
105-
pfo, pm, l = proxy[TruffleInteropSpecs::PolyglotMember.new]
105+
pfo, _, l = proxy[TruffleInteropSpecs::PolyglotMember.new]
106106
l.log.should_not include(['writeMember', :bar, :baz])
107107
-> { pfo.__send__(:foo=, :bar, :baz) }.should raise_error(ArgumentError)
108108
end
@@ -122,69 +122,69 @@
122122
end
123123

124124
it description['.call(*arguments)', :execute, ['*arguments']] do
125-
pfo, logging_proc, l = proxy[-> *x {x}]
126-
x = pfo.call(1, 2, 3)
125+
pfo, _, l = proxy[-> *x { x }]
126+
pfo.call(1, 2, 3)
127127
l.log.should include(['execute', 1, 2, 3])
128128
end
129129

130130
it description['.nil?', :isNull] do
131-
pfo, obj, l = proxy[Object.new]
131+
pfo, _, l = proxy[Object.new]
132132
pfo.nil?
133133
l.log.should include(['isNull'])
134134
end
135135

136136
it description['.size', :getArraySize] do
137-
pfo, obj, l = proxy[Object.new]
137+
pfo, _, l = proxy[Object.new]
138138
-> { pfo.size }.should raise_error(Polyglot::UnsupportedMessageError)
139139
l.log.should include(['getArraySize'])
140140
end
141141

142142
it description['.keys', :getMembers] do
143-
pfo, obj, l = proxy[Object.new]
143+
pfo, _, l = proxy[Object.new]
144144
pfo.keys
145145
l.log.should include(['getMembers', false])
146146
end
147147

148148
it description['.method_name', :invokeMember, ['method_name'], 'if member is invocable'] do
149-
pfo, obj, l = proxy[Class.new { def foo; 3; end }.new]
149+
pfo, _, l = proxy[Class.new { def foo; 3; end }.new]
150150
pfo.foo
151151
l.log.should include(["isMemberInvocable", "foo"])
152152
l.log.should include(["invokeMember", "foo"])
153153
end
154154

155155
it description['.method_name', :readMember, ['method_name'], 'if member is readable'] do
156-
pfo, obj, l = proxy[TruffleInteropSpecs::PolyglotMember.new]
156+
pfo, _, l = proxy[TruffleInteropSpecs::PolyglotMember.new]
157157
pfo.foo = :bar
158158
pfo.foo
159159
l.log.should include(["isMemberInvocable", "foo"])
160160
l.log.should include(["readMember", "foo"])
161161
end
162162

163163
it description['.method_name', :readMember, ['method_name'], 'and raises if member is not invocable or readable'] do
164-
pfo, obj, l = proxy[Object.new]
164+
pfo, _, l = proxy[Object.new]
165165
-> { pfo.foo }.should raise_error(NameError)
166166
l.log.should include(["isMemberInvocable", "foo"])
167167
l.log.should include(["readMember", "foo"])
168168
end
169169

170170
it description['.method_name(*arguments)', :invokeMember, ['method_name', '*arguments'], 'if member is readable and invokable'] do
171-
pfo, obj, l = proxy[Object.new]
171+
pfo, _, l = proxy[Object.new]
172172
-> { pfo.bar(1, 2, 3) }.should raise_error(NoMethodError)
173173
l.log.should include(["invokeMember", "bar", 1, 2, 3])
174174
end
175175

176176
it description['.method_name(*arguments, &block)', :invokeMember, ['method_name', '*arguments, block']] do
177177
pfo, pm, l = proxy[TruffleInteropSpecs::PolyglotMember.new]
178-
block = Proc.new {}
179-
pfo.foo = -> *x { 1 }
178+
block = Proc.new { }
179+
pfo.foo = -> *_ { 1 }
180180
pfo.foo(1, 2, 3, &block)
181181
l.log.should include(["invokeMember", "foo", 1, 2, 3, block])
182182
messages = pm.log
183183
messages.should include([:polyglot_invoke_member, "foo", 1, 2, 3, block])
184184
end
185185

186186
it description['.new(*arguments)', :instantiate, ['*arguments']] do
187-
pfo, obj, l = proxy[Object.new]
187+
pfo, _, l = proxy[Object.new]
188188
-> { pfo.new }.should raise_error(Polyglot::UnsupportedMessageError)
189189
l.log.should include(["instantiate"])
190190
end
@@ -196,7 +196,7 @@
196196
end
197197

198198
it description['.class', :getMetaObject] do
199-
pfo, obj, l = proxy[Truffle::Debug.foreign_object]
199+
pfo, _, l = proxy[Truffle::Debug.foreign_object]
200200
pfo.class.should == Truffle::Interop::Foreign
201201
Truffle::Interop.to_display_string(Truffle::Debug.foreign_object)
202202
l.log.should include(["hasMetaObject"])
@@ -208,37 +208,38 @@
208208
end
209209

210210
it description['.to_s', :asString, [], 'when `isString(foreign_object)` is true'] do
211-
pfo, str, l = proxy['asString contents']
211+
pfo, _, l = proxy['asString contents']
212212
pfo.to_s.should == "asString contents"
213213
l.log.should include(["asString"])
214214
end
215215

216216
it description['.to_s', :toDisplayString, [], 'otherwise'] do
217-
pfo, str, l = proxy[Object.new]
217+
pfo, _, l = proxy[Object.new]
218218
pfo.to_s
219219
l.log.should include(["toDisplayString", true])
220220
end
221221

222222
it description['.to_str', :asString, [], 'when `isString(foreign_object)` is true'] do
223-
pfo, str, l = proxy["asString contents"]
223+
pfo, _, l = proxy["asString contents"]
224224
pfo.to_str.should == "asString contents"
225225
l.log.should include(["isString"])
226226
l.log.should include(["asString"])
227227
end
228228

229229
it doc['.to_str', 'raises `NoMethodError` otherwise'] do
230-
pfo, obj, l = proxy[Object.new]
230+
pfo, _, l = proxy[Object.new]
231231
-> { pfo.to_str }.should raise_error(NoMethodError)
232+
l.log.should include(["isString"])
232233
end
233234

234235
it doc['.to_a', 'converts to a Ruby `Array` with `Truffle::Interop.to_array(foreign_object)`'] do
235-
pfo, obj, l = proxy[Object.new]
236+
pfo, _, l = proxy[Object.new]
236237
-> { pfo.to_a }.should raise_error(RuntimeError)
237238
l.log.should include(["hasArrayElements"])
238239
end
239240

240241
it doc['.to_ary', 'converts to a Ruby `Array` with `Truffle::Interop.to_array(foreign_object)`'] do
241-
pfo, obj, l = proxy[Object.new]
242+
pfo, _, l = proxy[Object.new]
242243
-> { pfo.to_a }.should raise_error(RuntimeError)
243244
l.log.should include(["hasArrayElements"])
244245
end
@@ -254,43 +255,43 @@
254255
end
255256

256257
it description['.respond_to?(:to_str)', :isString] do
257-
pfo, obj, l = proxy[Object.new]
258+
pfo, _, l = proxy[Object.new]
258259
pfo.respond_to?(:to_str)
259260
l.log.should include(["isString"])
260261
end
261262

262263
it description['.respond_to?(:to_a)', :hasArrayElements] do
263-
pfo, obj, l = proxy[Object.new]
264+
pfo, _, l = proxy[Object.new]
264265
pfo.respond_to?(:to_a)
265266
l.log.should include(["hasArrayElements"])
266267
end
267268

268269
it description['.respond_to?(:to_ary)', :hasArrayElements] do
269-
pfo, obj, l = proxy[Object.new]
270+
pfo, _, l = proxy[Object.new]
270271
pfo.respond_to?(:to_ary)
271272
l.log.should include(["hasArrayElements"])
272273
end
273274

274275
it description['.respond_to?(:size)', :hasArrayElements] do
275-
pfo, obj, l = proxy[Object.new]
276+
pfo, _, l = proxy[Object.new]
276277
pfo.respond_to?(:size)
277278
l.log.should include(["hasArrayElements"])
278279
end
279280

280281
it description['.respond_to?(:keys)', :hasMembers] do
281-
pfo, obj, l = proxy[Object.new]
282+
pfo, _, l = proxy[Object.new]
282283
pfo.respond_to?(:keys)
283284
l.log.should include(["hasMembers"])
284285
end
285286

286287
it description['.respond_to?(:call)', :isExecutable] do
287-
pfo, obj, l = proxy[Object.new]
288+
pfo, _, l = proxy[Object.new]
288289
pfo.respond_to?(:call)
289290
l.log.should include(["isExecutable"])
290291
end
291292

292293
it description['.respond_to?(:new)', :isInstantiable] do
293-
pfo, obj, l = proxy[Object.new]
294+
pfo, _, l = proxy[Object.new]
294295
pfo.respond_to?(:new)
295296
l.log.should include(["isInstantiable"])
296297
end

0 commit comments

Comments
 (0)