'rspec describe a rake task namespace

I want to test a specific namespace of rake tasks and I am getting an error from rubocop.

desc 'This namespace is test'
namespace :test_namespace do

  task test_task: :environment do

On my rake task I have the following

RSpec.describe 'test_namespace' do
  describe 'test_task' do

The above gives me an error

The first argument to describe should be the class or module being tested.


Solution 1:[1]

You just need to pass the class straight into your describe line of your test, instead of a string. In your case:

RSpec.describe TestNamespace do

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Millan