Today I discovered Ruby’s
Method#source_location. I was getting strange results in a test case and wanted to see what was going on inside of
I added a breakpoint to my test.
byebug xhr :get, :show, id: expected_user.id
And then in the console that came up from running the test I was able to pull up the file and line number for this method.
(byebug) self.method(:xhr).source_location ["/[...]/gems/actionpack-4.2.0/lib/action_controller/test_case.rb", 538]