test/helpers/test_xml_sitemap.rb in nanoc-4.7.10 vs test/helpers/test_xml_sitemap.rb in nanoc-4.7.11
- old
+ new
@@ -6,13 +6,24 @@
include Nanoc::Helpers::XMLSitemap
def setup
super
+ config = Nanoc::Int::Configuration.new.with_defaults
+ items = Nanoc::Int::IdentifiableCollection.new(config)
+ layouts = Nanoc::Int::IdentifiableCollection.new(config)
+ dep_store = Nanoc::Int::DependencyStore.new(items, layouts)
+ dependency_tracker = Nanoc::Int::DependencyTracker.new(dep_store)
+
@reps = Nanoc::Int::ItemRepRepo.new
- dependency_tracker = Nanoc::Int::DependencyTracker.new(nil)
- @view_context = Nanoc::ViewContext.new(reps: @reps, items: nil, dependency_tracker: dependency_tracker, compilation_context: :__irrelevant__, snapshot_repo: :__irrelevant_snapshot_repo)
+ @view_context = Nanoc::ViewContext.new(
+ reps: @reps,
+ items: nil,
+ dependency_tracker: dependency_tracker,
+ compilation_context: :__irrelevant__,
+ snapshot_repo: :__irrelevant_snapshot_repo,
+ )
@items = nil
@item = nil
@site = nil
@config = nil
@@ -50,11 +61,12 @@
# Create sitemap item
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'), @view_context)
# Create site
- @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil)
+ config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
+ @config = Nanoc::ConfigView.new(config, @view_context)
# Build sitemap
res = xml_sitemap
# Check
@@ -96,11 +108,12 @@
# Create sitemap item
@item = Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/')
# Create site
- @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil)
+ config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
+ @config = Nanoc::ConfigView.new(config, @view_context)
# Build sitemap
res = xml_sitemap(items: [item])
# Check
@@ -130,11 +143,12 @@
# Create sitemap item
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'), @view_context)
# Create site
- @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil)
+ config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
+ @config = Nanoc::ConfigView.new(config, @view_context)
# Build sitemap
res = xml_sitemap(rep_select: ->(rep) { rep.name == :one_a })
# Check
@@ -170,11 +184,12 @@
# Create sitemap item
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'), @view_context)
# Create site
- @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil)
+ config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
+ @config = Nanoc::ConfigView.new(config, @view_context)
# Build sitemap
res = xml_sitemap(items: @items)
# Check
@@ -201,10 +216,11 @@
# Create sitemap item
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap/'), @view_context)
# Create site
- @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil)
+ config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
+ @config = Nanoc::ConfigView.new(config, @view_context)
# Build sitemap
res = xml_sitemap(items: @items)
# Check