test/helpers/test_blogging.rb in nanoc-4.0.2 vs test/helpers/test_blogging.rb in nanoc-4.1.0a1

- old
+ new

@@ -45,11 +45,11 @@ # Create item 2 @items[2].expects(:compiled_content).with(snapshot: :pre).returns('item 2 content') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Cool Blog') @item.stubs(:[]).with(:author_name).returns('Denis Defreyne') @@ -76,11 +76,11 @@ @items[2].stubs(:[]).with(:updated_at).returns(Time.now - 250) @items[2].stubs(:[]).with(:created_at).returns(Time.now - 1200) @items[2].expects(:compiled_content).returns('item 2 content') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Cool Blog') @item.stubs(:[]).with(:author_name).returns('Denis Defreyne') @@ -97,11 +97,11 @@ if_have 'builder' do # Mock items @items = [mock_item, mock_item] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -122,11 +122,11 @@ if_have 'builder' do # Create items @items = [mock_item, mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: nil }) + @config = Nanoc::ConfigView.new({ base_url: nil }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -147,11 +147,11 @@ if_have 'builder' do # Create items @items = [mock_item, mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns(nil) @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -172,11 +172,11 @@ if_have 'builder' do # Create items @items = [mock_item, mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns(nil) @@ -202,11 +202,11 @@ @items[0].stubs(:[]).with(:author_name).returns('Don Alias') @items[0].stubs(:[]).with(:author_uri).returns('http://don.example.com/') @items[0].expects(:compiled_content).returns('item 1 content') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com/' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com/' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:kind).returns(nil) @item.stubs(:[]).with(:title).returns('My Cool Blog') @@ -244,11 +244,11 @@ if_have 'builder' do # Create items @items = [mock_item, mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -271,11 +271,11 @@ @items = [mock_item, mock_article, mock_article] @items[1].stubs(:[]).with(:created_at).returns(Time.now.to_s) @items[2].stubs(:[]).with(:created_at).returns(nil) # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -297,11 +297,11 @@ # Create items @items = [mock_item, mock_article] @items[1].expects(:compiled_content).with(snapshot: :pre).returns('asdf') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns(nil) @item.stubs(:[]).with(:author_name).returns(nil) @@ -323,14 +323,17 @@ @items = [mock_item, mock_article] @items[1].expects(:compiled_content).with(snapshot: :pre).returns('asdf') # Mock site @config = Nanoc::ConfigView.new( - author_name: 'Bob', - author_uri: 'http://example.com/~bob/', - title: 'My Blog Or Something', - base_url: 'http://example.com', + { + author_name: 'Bob', + author_uri: 'http://example.com/~bob/', + title: 'My Blog Or Something', + base_url: 'http://example.com', + }, + nil, ) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns(nil) @@ -351,11 +354,11 @@ @items[0].expects(:compiled_content).never @items[1].stubs(:[]).with(:title).returns('Item One') @items[1].expects(:compiled_content).with(snapshot: :pre).returns('asdf') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -375,11 +378,11 @@ article.stubs(:[]).with(:title).returns("Article #{i}") article.stubs(:[]).with(:created_at).returns(Time.now - i) end # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -408,11 +411,11 @@ end @items[0].stubs(:[]).with(:created_at).returns('23-02-2009') @items[1].stubs(:[]).with(:created_at).returns('22-03-2009') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -437,11 +440,11 @@ end @items[0].stubs(:[]).with(:created_at).returns('01-01-2015') @items[1].stubs(:[]).with(:created_at).returns('01-01-2014') # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -461,11 +464,11 @@ if_have 'builder' do # Mock article @items = [mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -482,11 +485,11 @@ if_have 'builder' do # Mock article @items = [mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -503,11 +506,11 @@ if_have 'builder' do # Mock article @items = [mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -524,11 +527,11 @@ if_have 'builder' do # Mock article @items = [mock_article] # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:[]).with(:title).returns('My Blog Or Something') @item.stubs(:[]).with(:author_name).returns('J. Doe') @@ -546,10 +549,10 @@ # Create items @items = [mock_article] @items[0].stubs(:path).returns(nil) # Mock site - @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }) + @config = Nanoc::ConfigView.new({ base_url: 'http://example.com' }, nil) # Create feed item @item = mock @item.stubs(:identifier).returns('/feed/') @item.stubs(:[]).with(:title).returns('My Cool Blog')