Skip to content
New issue

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

Minitest 4.7.5 test suite fails one test with rubinius 2.2.7 #3062

Closed
graaff opened this issue Jun 8, 2014 · 6 comments
Closed

Minitest 4.7.5 test suite fails one test with rubinius 2.2.7 #3062

graaff opened this issue Jun 8, 2014 · 6 comments

Comments

@graaff
Copy link

graaff commented Jun 8, 2014

Trying to run the minitest 4.7.5 test suite with rubinius 2.2.7 (2.1.0 build 2014-05-20 JI) [x86_64-linux-gnu] gives me this error:

  1) Error:
TestMiniTestMock#test_mock_args_does_not_raise:
NoMethodError: unmocked method :equal?, expected one of []
    kernel/common/kernel.rb:195:in `==='
    kernel/common/enumerable.rb:304:in `all?'
    kernel/bootstrap/array.rb:76:in `each'
    kernel/common/enumerable.rb:304:in `all?'
    /var/tmp/portage/dev-ruby/minitest-4.7.5-r1/work/rbx/minitest-4.7.5/test/minitest/test_minitest_mock.rb:72:in `test_mock_args_does_not_raise'
    kernel/common/enumerable.rb:49:in `collect'
    kernel/bootstrap/proc.rb:20:in `call'
    kernel/bootstrap/thread.rb:391:in `__run__'

Tests were run with "rbx -Ilib:bin:test:. -S testrb test"

@tak1n
Copy link
Member

tak1n commented Jun 18, 2014

Latest minitest version is also affected:

minitest-5.3.5  $ rbx -Ilib:test test/minitest/test_minitest_mock.rb                                                                                                                                            
Run options: --seed 22161

# Running:

.....................E.....................

Finished in 0.037957s, 1132.8609 runs/s, 1633.4273 assertions/s.

  1) Error:
TestMinitestMock#test_mock_args_does_not_raise:
NoMethodError: unmocked method :equal?, expected one of []
    kernel/common/kernel.rb:195:in `==='
    kernel/common/enumerable.rb:304:in `all?'
    kernel/bootstrap/array.rb:76:in `each'
    kernel/common/enumerable.rb:304:in `all?'
    test/minitest/test_minitest_mock.rb:72:in `test_mock_args_does_not_raise'
    kernel/bootstrap/proc.rb:20:in `call'
    kernel/bootstrap/thread.rb:391:in `__run__'

43 runs, 62 assertions, 0 failures, 1 errors, 0 skips
minitest-5.3.5  $                                    

@yorickpeterse
Copy link
Contributor

This seems to be the likely culprit: https://github.com/seattlerb/minitest/blob/master/lib/minitest/mock.rb#L23-L25. Currently trying to figure out if there's anything we can do about this.

@yorickpeterse
Copy link
Contributor

Repro extracted from the test suite:

require 'minitest'
require 'minitest/mock'

arg = Minitest::Mock.new
mock = Minitest::Mock.new
mock.expect(:foo, nil, [arg])
mock.foo(arg)

@yorickpeterse
Copy link
Contributor

Digging further, it seems this might cause the code to fail: https://github.com/seattlerb/minitest/blob/master/lib/minitest/mock.rb#L143-L145

That would end up calling === on the mock, which has been removed. I'm not 100% sure yet so I'll continue digging.

@yorickpeterse
Copy link
Contributor

Just tried this on Rbx master, issue is still present:

# /tmp/test.rb
require 'minitest'
require 'minitest/mock'

arg = Minitest::Mock.new
mock = Minitest::Mock.new
mock.expect(:foo, nil, [arg])
mock.foo(arg)
An exception occurred running /tmp/test.rb:

unmocked method :equal?, expected one of [] (NoMethodError)

Backtrace:

  Minitest::Mock#equal? (method_missing) at /home/yorickpeterse/.gem/rbx/2.1.0/gems/minitest-5.4.3/lib/minitest/mock.rb:114
              Kernel(Minitest::Mock)#=== at kernel/common/kernel.rb:204
        { } in Minitest::Mock#__script__ at /home/yorickpeterse/.gem/rbx/2.1.0/gems/minitest-5.4.3/lib/minitest/mock.rb:32
    { } in Minitest::Mock#method_missing at /home/yorickpeterse/.gem/rbx/2.1.0/gems/minitest-5.4.3/lib/minitest/mock.rb:144
           { } in Enumerable(Array)#all? at kernel/common/enumerable.rb:328
                              Array#each at kernel/bootstrap/array.rb:76
                  Enumerable(Array)#all? at kernel/common/enumerable.rb:328
     Minitest::Mock#foo (method_missing) at /home/yorickpeterse/.gem/rbx/2.1.0/gems/minitest-5.4.3/lib/minitest/mock.rb:143
                       Object#__script__ at /tmp/test.rb:7
        Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
        Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152
                 Rubinius::Loader#script at kernel/loader.rb:645
                   Rubinius::Loader#main at kernel/loader.rb:799

@brixen
Copy link
Member

brixen commented Jan 5, 2020

Rubinius will continue to maintain compatibility with the current stable version of MRI to the extent possible.

The focus for Rubinius in the near term is on the following capabilities:

  1. Instruction set
  2. Debugger
  3. Profiler
  4. Just-in-time compiler
  5. Concurrency
  6. Garbage collector

Contributions in the form of PRs for any of the areas of focus above, or for Ruby compatibility, are appreciated.

@brixen brixen closed this as completed Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants