spec/lib/fasterer/method_call_spec.rb in fasterer-0.1.9 vs spec/lib/fasterer/method_call_spec.rb in fasterer-0.1.10
- old
+ new
@@ -464,9 +464,22 @@
expect(method_call.arguments[0].value).to eq(1)
end
end
+ describe 'method call with symbol to proc argument' do
+ let(:code) { '[].select(&:zero?)' }
+
+ let(:call_element) { ripper }
+
+ it 'should detect block pass argument' do
+ expect(method_call.method_name).to eq(:select)
+ expect(method_call.arguments.count).to eq(1)
+ expect(method_call.arguments[0].type).to eq(:block_pass)
+ expect(method_call.has_block?).to be
+ end
+ end
+
describe 'method call with equals operator' do
let(:code) { 'method_call_with_equals.rb' }
let(:call_element) { ripper.drop(1).first.first[1] }