Follow naming conventions in generated plugin test

This commit ensures that a generated test file like "foo/bar_test.rb"
defines the class `Foo::BarTest` rather than `Foo::Bar::Test`.
This commit is contained in:
Jonathan Hefner 2020-07-30 20:43:07 -05:00
parent fa717a61ea
commit 0098088fc1
2 changed files with 5 additions and 2 deletions

@ -1,6 +1,6 @@
require "test_helper"
class <%= camelized_modules %>::Test < ActiveSupport::TestCase
class <%= camelized_modules %>Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, <%= camelized_modules %>
end

@ -76,7 +76,10 @@ def test_generating_without_options
end
assert_file "lib/bukkits/railtie.rb", /module Bukkits\n class Railtie < ::Rails::Railtie\n end\nend/
assert_file "lib/bukkits.rb", /require "bukkits\/railtie"/
assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/
assert_file "test/bukkits_test.rb" do |content|
assert_match(/class BukkitsTest < ActiveSupport::TestCase/, content)
assert_match(/assert_kind_of Module, Bukkits/, content)
end
assert_file "bin/test"
assert_no_file "bin/rails"
end