How to test block parameters which is sending to method with arguments?

Hai

I would like to know how to test block parameters send to method with
arguments…

Problem:

Here i would like to get weather report basing on city_name.

here my method name is request and i am sending :get_cities_weather
as argument to that method.

@cities_weather = request(:get_cities_weather) do

soap.body = { weather_request =>{:city_name => “Banglore” } }

end

Issue:

Here My problem is with block and i would like to know how to test
block params i.e

soap.body = { weather_request =>{:city_name => “Banglore” } }

Here i need to test soap.body key name i.e “weather_request”
wheather i am sending exact key name or not??

Could u please help me how to test it???

What if you test the result of your code working then test what it does
when
it doen’t work? That way you’re testing how your code behaves instead of
its
internal state.

But to answer your question you can use the sourcify gem to add
to_source
to a proc.