Skip to content

Commit 4d16352

Browse files
committed
Give Sitemap class a name
It is not user-friendly to have anonymous classes. They are hard to debug. So let's give the SitemapGenerator::Sitemap's class a name (Config)
1 parent df52808 commit 4d16352

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/sitemap_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module SitemapGenerator
4040
}
4141

4242
# Lazy-initialize the LinkSet instance
43-
Sitemap = (Class.new do
43+
Sitemap = (Config = Class.new do
4444
# Use a new LinkSet instance
4545
def reset!
4646
@link_set = LinkSet.new

spec/sitemap_generator/sitemap_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
RSpec.describe SitemapGenerator::Sitemap do
44
subject { described_class }
55

6+
it "has a class name" do
7+
expect(subject.class.name).to match "SitemapGenerator::"
8+
end
9+
610
describe "method missing" do
711
it "should not be public" do
812
expect(subject.methods).to_not include :method_missing

0 commit comments

Comments
 (0)