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

undefined method `metadata_for_test_name', revisited #17

Open
The-Alchemist opened this issue Apr 27, 2022 · 0 comments
Open

undefined method `metadata_for_test_name', revisited #17

The-Alchemist opened this issue Apr 27, 2022 · 0 comments

Comments

@The-Alchemist
Copy link

The-Alchemist commented Apr 27, 2022

Looks like someone bumped into this error years ago (#9 ), but I'm not sure if it's for the same reason. Looks like it's not possible mix spec's and regular minitests? We have a mixture of both, so it would be great to run them all with the same execution.

Test that Fails

It's just a blank minitest:

# frozen_string_literal: true

require 'minitest/test'

class SomeTest < Minitest::Test

  def test_empty
  end

end
minitest spec/blank_minitest.test.rb --tag random_tag

Error

/minispec-metadata/lib/minispec-metadata/tags.rb:61:in `block in runnable_method_matches_any_tags?': undefined method `metadata_for_test_name' for SomeTest:Class (NoMethodError)
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:60:in `any?'
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:60:in `runnable_method_matches_any_tags?'
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:49:in `runnable_method_matches_any_inclusive_tag?'
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:38:in `block in runnable_methods'
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:37:in `select!'
	from /Users/user/Development/minispec-metadata/lib/minispec-metadata/tags.rb:37:in `runnable_methods'
	from /usr/local/lib/ruby/gems/2.6.0/gems/minitest-5.15.0/lib/minitest.rb:161:in `block in __run'
	from /usr/local/lib/ruby/gems/2.6.0/gems/minitest-5.15.0/lib/minitest.rb:161:in `reject'
	from /usr/local/lib/ruby/gems/2.6.0/gems/minitest-5.15.0/lib/minitest.rb:161:in `__run'
	from /usr/local/lib/ruby/gems/2.6.0/gems/minitest-5.15.0/lib/minitest.rb:146:in `run'
	from /usr/local/lib/ruby/gems/2.6.0/gems/minitest-5.15.0/lib/minitest.rb:73:in `block in autorun'

How to Reproduce

  1. git clone git@github.com:The-Alchemist/minispec-metadata.git --branch 'bug/error_with_spec_and_regular_tests'
  2. cd minispec-metadata && minitest spec/blank_minitest.test.rb --tag random_tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant