rubocop-extension-generator icon indicating copy to clipboard operation
rubocop-extension-generator copied to clipboard

Bug Report: Invalid module name

Open ydakuka opened this issue 1 year ago • 0 comments

Actual behavior

I run the command:

$ rubocop-extension-generator rubocop-foobar

And I got the following files:

# rubocop-foobar/sig/rubocop/foobar.rbs

module Rubocop
  module Foobar
    VERSION: String
    # See the writing guide of rbs: https://github.com/ruby/rbs#guides
  end
end
# rubocop-foobar/spec/rubocop/foobar_spec.rb

module Rubocop
  module Foobar
    VERSION: String
    # See the writing guide of rbs: https://github.com/ruby/rbs#guides
  end
end

Then I run rspec:

ydakuka@yauhenid:~/Work/rubocop-foobar$ rspec spec/

An error occurred while loading ./spec/rubocop/foobar_spec.rb.
Failure/Error:
  RSpec.describe Rubocop::Foobar do
    it "has a version number" do
      expect(Rubocop::Foobar::VERSION).not_to be nil
    end
  
    it "does something useful" do
      expect(false).to eq(true)
    end
  end

NameError:
  uninitialized constant Rubocop
  Did you mean?  RuboCop
# ./spec/rubocop/foobar_spec.rb:3:in `<top (required)>'
No examples found.

Finished in 0.00002 seconds (files took 0.69338 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Expected behavior

Rubocop -> RuboCop

RuboCop version

ydakuka@yauhenid:~/Work/rubocop-foobar$ rubocop -V
1.51.0 (using Parser 3.2.2.1, rubocop-ast 1.28.1, running on ruby 2.7.6) [x86_64-linux]

ydakuka@yauhenid:~/Work/rubocop-foobar$ rubocop-extension-generator -v
rubocop-extension-generator 0.5.2

ydakuka avatar May 22 '23 13:05 ydakuka