rubygem-flexmock/rubygem-flexmock-2.3.6-testsuite-binding-source.patch
Mamoru TASAKA 69f054c9a8 Patch to support ruby 3.0
Use binding.source_location for test
  Properly accept argument and keywords
  Relax error message on test a bit
2021-01-24 03:20:08 +09:00

11 lines
449 B
Diff

--- flexmock-2.3.6/test/test_helper.rb.ruby3 2021-01-24 00:41:42.121385766 +0900
+++ flexmock-2.3.6/test/test_helper.rb 2021-01-24 00:44:25.866236105 +0900
@@ -50,7 +50,7 @@
# added.
def assert_mock_failure(klass, options={}, &block)
ex = assert_failure(klass, options, &block)
- file = eval("__FILE__", block.binding)
+ file = block.binding.source_location.first
assert_matching_line(ex, file, options)
end