We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require 'test/unit/rr' class Klass def write(txt, silent: true) puts(txt) unless silent end end class TestKlass < Test::Unit::TestCase test "write" do c = Klass.new mock.proxy(c).write("write", silent: false).once c.write("write", silent: false) end end
$ rbenv local 2.6.6 $ ruby -w -I"lib:test" test_proxy.rb Loaded suite test_proxy Started write . Finished in 0.000560186 seconds. --------------------------------------------------------------------------------------------------------------------------------------------- 1 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed --------------------------------------------------------------------------------------------------------------------------------------------- 1785.12 tests/s, 0.00 assertions/s
$ rbenv local 3.0.0 $ ruby -w -I"lib:test" test_proxy.rb Loaded suite test_proxy Started E ============================================================================================================================================= test_proxy.rb:13:in `block in <class:TestKlass>' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:148:in `write' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:40:in `dispatch_method' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:183:in `dispatch_method' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:16:in `call' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:41:in `call_implementation' /home/aho/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:30:in `call_original_method' test_proxy.rb:4:in `write' Error: test: write(TestKlass): ArgumentError: wrong number of arguments (given 2, expected 1) ============================================================================================================================================= Finished in 0.001129911 seconds. --------------------------------------------------------------------------------------------------------------------------------------------- 1 tests, 0 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications 0% passed --------------------------------------------------------------------------------------------------------------------------------------------- 885.03 tests/s, 0.00 assertions/s
The text was updated successfully, but these errors were encountered:
d6da209
I've released RR 3.0.0 that supports Ruby 3.0.
Sorry, something went wrong.
Thanks!
No branches or pull requests
Example test code
Result on Ruby 2.6.6
Result on Ruby 3.0.0
The text was updated successfully, but these errors were encountered: