This is locigal, as at this point the RSpec::Core class will be defined. Which doesn't automatically mean that RSpec.configure is available (as only parts for Rspec::Core will be loaded). I guess a better check here would be to also test for Rspec.configure being present like so:
if defined?(RSpec::Core) && RSpec.respond_to?(:configure)
What did you do?
Run a rake task which includes rspec rake tasks like this:
require 'rspec/core/rake_task'
Which is quite a common line added on top of many
Rakefile
s as it makes Rspec commands available as rake tasks.What did you expect to happen?
The rake task to succeed.
What actually happened?
I got an error
NoMethodError: undefined method 'configure' for RSpec:Module
from withinanyway_config-2.4.1/lib/anyway/testing.rb
Additional context
This is locigal, as at this point the RSpec::Core class will be defined. Which doesn't automatically mean that RSpec.configure is available (as only parts for Rspec::Core will be loaded). I guess a better check here would be to also test for Rspec.configure being present like so:
Environment
Ruby Version: 2.7.2p137
Rspec version: rspec-core-3.12.2
Anyway Config Version: 2.4.1