repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/helpers/test_xml_sitemap.rb | nanoc/test/helpers/test_xml_sitemap.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
include Nanoc::Helpers::XMLSitemap
def setup
super
root_item = Nanoc::Core::Item.new('base', {}, '/base.md')
config = Nanoc::Core::Configuration.new(dir: Dir.getwd).with_defaults
items = Nanoc:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/helpers/test_capturing.rb | nanoc/test/helpers/test_capturing.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
include Nanoc::Helpers::Capturing
def item_rep_repo_for(item)
Nanoc::Core::ItemRepRepo.new.tap do |repo|
repo << Nanoc::Core::ItemRep.new(item, :default)
end
end
def view_context_for(item)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/extra/core_ext/test_time.rb | nanoc/test/extra/core_ext/test_time.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::ExtraCoreExtTimeTest < Nanoc::TestCase
def test___nanoc_to_iso8601_date_utc
assert_equal('2008-05-19', Time.utc(2008, 5, 19, 14, 20, 0, 0).__nanoc_to_iso8601_date)
end
def test___nanoc_to_iso8601_date_non_utc
assert_equal('2008-05-18', Time.ne... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_slim.rb | nanoc/test/filters/test_slim.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::SlimTest < Nanoc::TestCase
def test_filter
# Create filter
filter = ::Nanoc::Filters::Slim.new(rabbit: 'The rabbit is on the branch.')
# Run filter (no assigns)
result = filter.setup_and_run('html')
assert_match(%r{<html>.*</... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_relativize_paths.rb | nanoc/test/filters/test_relativize_paths.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RelativizePathsTest < Nanoc::TestCase
def test_filter_html_with_double_quotes
# Create filter with mock item
filter = Nanoc::Filters::RelativizePaths.new
# Mock item
filter.instance_eval do
@item_rep = Nanoc::Core::ItemRep.n... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_rainpress.rb | nanoc/test/filters/test_rainpress.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RainpressTest < Nanoc::TestCase
def test_filter
# Create filter
filter = ::Nanoc::Filters::Rainpress.new
# Run filter
result = filter.setup_and_run('body { color: black; }')
assert_equal('body{color:#000}', result)
end
d... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_kramdown.rb | nanoc/test/filters/test_kramdown.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::KramdownTest < Nanoc::TestCase
def test_filter
# Create filter
filter = ::Nanoc::Filters::Kramdown.new
# Run filter
result = filter.setup_and_run('This is _so_ **cool**!')
assert_equal("<p>This is <em>so</em> <strong>cool</st... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_handlebars.rb | nanoc/test/filters/test_handlebars.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::HandlebarsTest < Nanoc::TestCase
def test_filter
if_have 'handlebars' do
# Create data
item = Nanoc::Core::Item.new(
'content',
{ title: 'Max Payne', protagonist: 'Max Payne', location: 'here' },
'/games/max... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_haml.rb | nanoc/test/filters/test_haml.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::HamlTest < Nanoc::TestCase
def test_filter
# Create filter
filter = ::Nanoc::Filters::Haml.new(question: 'Is this the Payne residence?')
# Run filter (no assigns)
result = filter.setup_and_run('%html')
assert_match(%r{<html>.... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_pandoc.rb | nanoc/test/filters/test_pandoc.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::PandocTest < Nanoc::TestCase
def test_filter
if_have 'pandoc-ruby' do
skip_unless_have_command 'pandoc'
# Create filter
filter = ::Nanoc::Filters::Pandoc.new
# Run filter
result = filter.setup_and_run("# Heading... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_mustache.rb | nanoc/test/filters/test_mustache.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::MustacheTest < Nanoc::TestCase
def test_filter
# Create item
item = Nanoc::Core::Item.new(
'content',
{ title: 'Max Payne', protagonist: 'Max Payne' },
'/games/max-payne',
)
# Create filter
filter = ::Nanoc::... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_redcloth.rb | nanoc/test/filters/test_redcloth.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RedClothTest < Nanoc::TestCase
def setup
super
skip_unless_have 'redcloth'
end
def test_filter
# Get filter
filter = ::Nanoc::Filters::RedCloth.new
# Run filter
result = filter.setup_and_run('h1. Foo')
assert_equ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_rubypants.rb | nanoc/test/filters/test_rubypants.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RubyPantsTest < Nanoc::TestCase
def test_filter
# Get filter
filter = ::Nanoc::Filters::RubyPants.new
# Run filter
result = filter.setup_and_run('Wait---what?')
assert_equal('Wait—what?', result)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_coffeescript.rb | nanoc/test/filters/test_coffeescript.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::CoffeeScriptTest < Nanoc::TestCase
def test_filter
if_have 'coffee-script' do
# Create filter
filter = ::Nanoc::Filters::CoffeeScript.new
# Run filter (no assigns)
result = filter.setup_and_run('alert 42')
asser... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_xsl.rb | nanoc/test/filters/test_xsl.rb | # frozen_string_literal: true
require 'helper'
require 'tempfile'
class Nanoc::Filters::XSLTest < Nanoc::TestCase
SAMPLE_XSL = <<~EOS
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding=... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_rdoc.rb | nanoc/test/filters/test_rdoc.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RDocTest < Nanoc::TestCase
def test_filter
# Get filter
filter = ::Nanoc::Filters::RDoc.new
# Run filter
result = filter.setup_and_run('= Foo')
assert_match(%r{\A\s*<h1( id="label-Foo")?>.*Foo.*</h1>\s*\Z}, result)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_rdiscount.rb | nanoc/test/filters/test_rdiscount.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RDiscountTest < Nanoc::TestCase
def test_filter
if_have 'rdiscount' do
# Create filter
filter = ::Nanoc::Filters::RDiscount.new
# Run filter
result = filter.setup_and_run('> Quote')
assert_match(%r{<blockquote>\... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_maruku.rb | nanoc/test/filters/test_maruku.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::MarukuTest < Nanoc::TestCase
def test_filter
# Create filter
filter = ::Nanoc::Filters::Maruku.new
# Run filter
result = filter.setup_and_run('This is _so_ *cool*!')
assert_equal('<p>This is <em>so</em> <em>cool</em>!</p>', r... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_markaby.rb | nanoc/test/filters/test_markaby.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::MarkabyTest < Nanoc::TestCase
def test_filter
skip 'known broken on Ruby 3.x' if RUBY_VERSION.start_with?('3')
# Create filter
filter = ::Nanoc::Filters::Markaby.new
# Run filter
result = filter.setup_and_run("html do\nend")
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_typogruby.rb | nanoc/test/filters/test_typogruby.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::TypogrubyTest < Nanoc::TestCase
def test_filter
if_have 'typogruby' do
# Get filter
filter = ::Nanoc::Filters::Typogruby.new
# Run filter
a = '"Typogruby makes HTML look smarter & better, don\'t you think?"'
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_yui_compressor.rb | nanoc/test/filters/test_yui_compressor.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::YUICompressorTest < Nanoc::TestCase
def test_filter_javascript
if __dir__.include?(' ')
skip 'YUICompressor does not support spaces in path'
end
skip_unless_have_command 'java'
if_have 'yuicompressor' do
filter = ::Nan... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_erubis.rb | nanoc/test/filters/test_erubis.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ErubisTest < Nanoc::TestCase
def test_filter_with_instance_variable
# Create filter
filter = ::Nanoc::Filters::Erubis.new(location: 'a cheap motel')
# Run filter
result = filter.setup_and_run('<%= "I was hiding in #{@location}." %... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_erubi.rb | nanoc/test/filters/test_erubi.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ErubiTest < Nanoc::TestCase
def test_filter_with_instance_variable
# Create filter
filter = ::Nanoc::Filters::Erubi.new(location: 'a cheap motel')
# Run filter
result = filter.setup_and_run('<%= "I was hiding in #{@location}." %>'... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_bluecloth.rb | nanoc/test/filters/test_bluecloth.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::BlueClothTest < Nanoc::TestCase
def test_filter
skip_unless_have 'bluecloth'
# Skip if nonfunctional
begin
::BlueCloth.new('# hi').to_html
rescue ArgumentError => e
skip 'BlueCloth is broken on this platform' if e.mess... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_redcarpet.rb | nanoc/test/filters/test_redcarpet.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::RedcarpetTest < Nanoc::TestCase
def setup
super
skip_unless_have 'redcarpet'
end
def test_find
refute_nil Nanoc::Filter.named(:redcarpet)
end
def test_filter
# Create filter
filter = ::Nanoc::Filters::Redcarpet.new
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/test_terser.rb | nanoc/test/filters/test_terser.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::TerserTest < Nanoc::TestCase
def test_filter
if_have 'terser' do
# Create filter
filter = ::Nanoc::Filter.named(:terser).new
# Run filter
input = 'foo = 1; (function(bar) { if (true) alert(bar); })(foo)'
result =... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/colorize_syntax/test_common.rb | nanoc/test/filters/colorize_syntax/test_common.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ColorizeSyntax::CommonTest < Nanoc::TestCase
def test_dummy
if_have 'nokogiri' do
# Create filter
filter = ::Nanoc::Filters::ColorizeSyntax.new
# Get input and expected output
input = '<pre title="moo"><code class="lan... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/colorize_syntax/test_simon.rb | nanoc/test/filters/colorize_syntax/test_simon.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ColorizeSyntax::SimonTest < Nanoc::TestCase
def test_simon_highlight
if_have 'nokogiri' do
skip_unless_have_command 'highlight'
# Create filter
filter = ::Nanoc::Filters::ColorizeSyntax.new
# Get input and expected ou... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/colorize_syntax/test_pygments.rb | nanoc/test/filters/colorize_syntax/test_pygments.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ColorizeSyntax::PygmentsTest < Nanoc::TestCase
def test_pygmentsrb
skip 'pygments.rb does not support Windows' if Nanoc::Core.on_windows?
skip 'pygments.rb fails with spaces in paths' if __dir__.match?(/ /)
if_have 'pygments', 'nokogi... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/colorize_syntax/test_pygmentize.rb | nanoc/test/filters/colorize_syntax/test_pygmentize.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ColorizeSyntax::PygmentizeTest < Nanoc::TestCase
def test_pygmentize
if_have 'nokogiri' do
skip_unless_have_command 'pygmentize'
# Create filter
filter = ::Nanoc::Filters::ColorizeSyntax.new
# Get input and expected o... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/filters/colorize_syntax/test_coderay.rb | nanoc/test/filters/colorize_syntax/test_coderay.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::Filters::ColorizeSyntax::CoderayTest < Nanoc::TestCase
CODERAY_PRE = '<div class="CodeRay"><div class="code">'
CODERAY_POST = '</div></div>'
def test_coderay_simple
if_have 'nokogiri' do
# Create filter
filter = ::Nanoc::Filters::Colo... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/rule_dsl/test_compiler_dsl.rb | nanoc/test/rule_dsl/test_compiler_dsl.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::RuleDSL::CompilerDSLTest < Nanoc::TestCase
def test_compile
# TODO: implement
end
def test_route
# TODO: implement
end
def test_layout
# TODO: implement
end
def test_preprocess_twice
rules_collection = Nanoc::RuleDSL::RulesCo... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/rule_dsl/test_action_provider.rb | nanoc/test/rule_dsl/test_action_provider.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::RuleDSL::ActionProviderTest < Nanoc::TestCase
def new_action_provider(site)
rules_collection = Nanoc::RuleDSL::RulesCollection.new
action_sequence_calculator =
Nanoc::RuleDSL::ActionSequenceCalculator.new(
rules_collection:, site:,
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/rule_dsl/test_rules_collection.rb | nanoc/test/rule_dsl/test_rules_collection.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::RuleDSL::RulesCollectionTest < Nanoc::TestCase
def test_compilation_rule_for
# Mock rules
rules = [mock, mock, mock]
rules[0].expects(:applicable_to?).returns(false)
rules[1].expects(:applicable_to?).returns(true)
rules[1].expects(:rep_... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/data_sources/test_filesystem.rb | nanoc/test/data_sources/test_filesystem.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
def new_data_source(params = nil)
with_site do |site|
Nanoc::DataSources::Filesystem.new(site.config, nil, nil, params)
end
end
def test_load_objects
# Create data source
data_source ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/test/data_sources/test_filesystem_tools.rb | nanoc/test/data_sources/test_filesystem_tools.rb | # frozen_string_literal: true
require 'helper'
class Nanoc::DataSources::FilesystemToolsTest < Nanoc::TestCase
def setup
super
skip_unless_symlinks_supported
end
def test_all_files_in_follows_symlinks_to_dirs
# Write sample files
16.times do |i|
FileUtils.mkdir_p("dir#{i}")
File.wri... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/regression_filenames_spec.rb | nanoc/spec/regression_filenames_spec.rb | # frozen_string_literal: true
describe 'regression tests', chdir: false do
let(:regression_test_filenames) do
Dir['spec/nanoc/regressions/*']
end
let(:regression_test_numbers) do
regression_test_filenames
.map { |fn| File.readlines(fn).find { |l| l =~ /^describe/ }.match(/GH-(\d+)/)[1] }
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/contributors_spec.rb | nanoc/spec/contributors_spec.rb | # frozen_string_literal: true
describe 'list of contributors in README', chdir: false do
let(:contributors_in_readme) do
File.readlines('../README.md').last.chomp.split(', ')
end
let(:contributors_in_release_notes) do
File.read('NEWS.md').scan(/\[[^\]]+\]$/).map { |s| s[1..-2].split(', ') }.flatten
en... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/manifest_spec.rb | nanoc/spec/manifest_spec.rb | # frozen_string_literal: true
describe 'manifest', chdir: false do
example do
expect('nanoc').to have_a_valid_manifest
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/meta_spec.rb | nanoc/spec/meta_spec.rb | # frozen_string_literal: true
describe 'meta', chdir: false do
it 'has the same license for all projects' do
Dir.chdir('..') do
root_license = File.read('LICENSE').sub(/20\d\d/, '20xx')
projects = %w[nanoc guard-nanoc] + Dir['nanoc-*']
projects.each do |project|
project_license = File.... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/gem_spec.rb | nanoc/spec/gem_spec.rb | # frozen_string_literal: true
describe 'nanoc.gem', :stdio, chdir: false do
subject do
TTY::Command.new.run('gem build nanoc.gemspec')
end
around do |ex|
Dir['*.gem'].each { |f| FileUtils.rm(f) }
ex.run
Dir['*.gem'].each { |f| FileUtils.rm(f) }
end
it 'builds gem' do
expect { subject }
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/spec_helper.rb | nanoc/spec/spec_helper.rb | # frozen_string_literal: true
require_relative '../../common/spec/spec_helper_head'
require_relative '../../common/spec/spec_helper_foot'
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/version_spec.rb | nanoc/spec/nanoc/version_spec.rb | # frozen_string_literal: true
describe Nanoc::VERSION do
it 'is the same as Nanoc::Core::VERSION' do
expect(Nanoc::VERSION).to eq(Nanoc::Core::VERSION)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/orig_cli_spec.rb | nanoc/spec/nanoc/orig_cli_spec.rb | # frozen_string_literal: true
describe Nanoc::OrigCLI do
let(:all_commands) do
ObjectSpace.each_object(Cri::Command)
end
let(:exceptions) do
# FIXME: [Nanoc 5] Get rid of these exceptions
[
['deploy', ['C']],
['help', ['v']],
['check', ['d']],
]
end
def ancestors_of_comman... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/spec_spec.rb | nanoc/spec/nanoc/spec_spec.rb | # frozen_string_literal: true
describe Nanoc::Spec::HelperContext do
subject(:ctx) { described_class.new(helper) }
let(:helper) do
Module.new {}
end
it 'has no items by default' do
# TODO: Add #empty? to item collection view
expect(subject.items.size).to eq(0)
end
it 'has no layouts by defau... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_815_spec.rb | nanoc/spec/nanoc/regressions/gh_815_spec.rb | # frozen_string_literal: true
describe 'GH-815', :site, :stdio do
before do
File.write('nanoc.yaml', "animal: \"donkey\"\n")
File.write('content/foo.md', '<%= @config.key?(:animal) %>')
File.write('Rules', <<EOS)
compile '/**/*' do
filter :erb
write item.identifier.without_ext + '.txt'
end
EO... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_928_spec.rb | nanoc/spec/nanoc/regressions/gh_928_spec.rb | # frozen_string_literal: true
describe 'GH-928', :site, :stdio do
example do
expect { Nanoc::CLI.run(%w[check --list]) }.to output(/^ css$/).to_stdout
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_761_spec.rb | nanoc/spec/nanoc/regressions/gh_761_spec.rb | # frozen_string_literal: true
describe 'GH-761', :site do
before do
File.write('content/donkey.md', 'Compiled content donkey!')
File.write('layouts/foo.erb', '[<%= @item.compiled_content %>]')
File.write('Rules', <<EOS)
compile '/**/*' do
layout '/foo.*'
write '/donkey.html'
end
layout '... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_891_spec.rb | nanoc/spec/nanoc/regressions/gh_891_spec.rb | # frozen_string_literal: true
describe 'GH-891', :site, :stdio do
before do
File.write('layouts/foo.erb', 'giraffes? <%= yield %>')
File.write('Rules', <<EOS)
preprocess do
items.create('yes!', {}, '/hello.html')
end
compile '/**/*' do
layout '/foo.*'
write item.identifier.without_ext + '.... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1100_spec.rb | nanoc/spec/nanoc/regressions/gh_1100_spec.rb | # frozen_string_literal: true
describe 'GH-1100', :site, :stdio do
before do
File.write('content/index.html', '<% @items["stuff"] %>')
File.write('Rules', <<EOS)
preprocess do
@items.delete_if { |i| false }
end
compile '/**/*.html' do
filter :erb
write item.identifier.to_s
end
EOS
end... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1031_spec.rb | nanoc/spec/nanoc/regressions/gh_1031_spec.rb | # frozen_string_literal: true
describe 'GH-1031', :site, :stdio do
before do
File.write('content/foo.md', '[<%= @items["/bar.*"].compiled_content %>]')
File.write('content/bar.md', 'I am bar!')
File.write('Rules', <<EOS)
compile '/bar.*' do
write '/bar.txt'
end
compile '/foo.*', rep: :default... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_947_spec.rb | nanoc/spec/nanoc/regressions/gh_947_spec.rb | # frozen_string_literal: true
describe 'GH-947', :site, :stdio do
before do
File.write('content/foo.md', 'Foo!')
File.write('Rules', <<EOS)
compile '/foo.*' do
write '/foo'
end
EOS
File.open('nanoc.yaml', 'w') do |io|
io << 'prune:' << "\n"
io << ' auto_prune: true' << "\n"
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1107_spec.rb | nanoc/spec/nanoc/regressions/gh_1107_spec.rb | # frozen_string_literal: true
describe 'GH-1107', :site, :stdio do
before do
File.write('Rules', <<EOS)
compile '/**/*.html' do
garbage(data/**/*)
end
EOS
end
it 'raises the proper exception' do
expect { Nanoc::CLI.run(%w[compile --verbose]) }.to raise_error(SyntaxError)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1171_spec.rb | nanoc/spec/nanoc/regressions/gh_1171_spec.rb | # frozen_string_literal: true
describe 'GH-1171', :site, :stdio do
before do
File.write('nanoc.yaml', <<~EOS)
data_sources:
-
type: filesystem
encoding: utf-8
EOS
end
context 'UTF-8 code in ASCII env' do
before do
File.write('content/hi.md', '<%= ::EMOJI_🔥 %>... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_937_spec.rb | nanoc/spec/nanoc/regressions/gh_937_spec.rb | # frozen_string_literal: true
describe 'GH-937', :site, :stdio do
before do
File.write('content/style.sass', ".test\n color: red")
File.write(
'nanoc.yaml',
"sass_style: compact\nenvironments:\n staging:\n sass_style: expanded",
)
File.write('Rules', <<~EOS)
compile '/*.sass'... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1372_spec.rb | nanoc/spec/nanoc/regressions/gh_1372_spec.rb | # frozen_string_literal: true
describe 'GH-1372', :site, :stdio do
before do
FileUtils.mkdir_p('content')
File.write('content/home.erb', 'hello')
FileUtils.mkdir_p('layouts')
File.write('layouts/default.haml', '#main= yield')
File.write('Rules', <<~EOS)
compile '/*' do
layout '/de... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_813_spec.rb | nanoc/spec/nanoc/regressions/gh_813_spec.rb | # frozen_string_literal: true
describe 'GH-813', :site, :stdio do
before do
File.write('nanoc.yaml', "enable_output_diff: true\n")
File.write('content/greeting.md', 'Hallöchen!')
File.write('Rules', <<EOS)
compile '/**/*' do
snapshot :donkey, path: '/donkey.html'
filter :kramdown
end
EOS
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1358_spec.rb | nanoc/spec/nanoc/regressions/gh_1358_spec.rb | # frozen_string_literal: true
describe 'GH-1358', :site, :stdio do
before do
FileUtils.mkdir_p('content')
File.write('content/foo.dat', 'hi')
File.write('content/home.erb', '<%= File.read(@items["/foo.*"].raw_filename) %>')
File.write('Rules', <<~EOS)
ignore '/*.dat'
compile '/*' do
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1130_spec.rb | nanoc/spec/nanoc/regressions/gh_1130_spec.rb | # frozen_string_literal: true
describe 'GH-1130', :site, :stdio do
before do
File.write('content/foo', 'asdf')
File.write('Rules', <<~EOS)
passthrough '/**/*'
EOS
File.write('Checks', <<~EOS)
check :wat do
@items.flat_map(&:reps).map(&:raw_path)
end
EOS
end
it 'do... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_974_spec.rb | nanoc/spec/nanoc/regressions/gh_974_spec.rb | # frozen_string_literal: true
describe 'GH-974', :site, :stdio do
before do
File.write('content/foo.md', 'foo')
File.write('Rules', <<~EOS)
compile '/foo.*' do
write item.identifier
end
EOS
end
it 'writes to path corresponding to identifier' do
Nanoc::CLI.run(%w[compile])
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1428_spec.rb | nanoc/spec/nanoc/regressions/gh_1428_spec.rb | # frozen_string_literal: true
describe 'GH-1428', :site, :stdio do
before do
FileUtils.mkdir_p('layouts')
File.write('layouts/default.erb', 'layout stuff')
File.write('Rules', <<~EOS)
ignore '/*'
layout '/*', :erb
EOS
end
example do # rubocop:disable RSpec/NoExpectationExample
N... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1463_spec.rb | nanoc/spec/nanoc/regressions/gh_1463_spec.rb | # frozen_string_literal: true
describe 'GH-1463', :site, :stdio do
before do
FileUtils.mkdir_p('content')
FileUtils.mkdir_p('content/org1')
File.write('content/org1.erb', <<~CONTENT)
<ul>
<% children_of(@item).each do |c| %>
<li><%= c[:title] %></li>
<% end %>
</ul>
C... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1248_spec.rb | nanoc/spec/nanoc/regressions/gh_1248_spec.rb | # frozen_string_literal: true
describe 'GH-1248', :site, :stdio do
before do
File.write('content/stuff.html', 'hi')
File.write('Rules', <<~EOS)
preprocess do
@config[:output_dir] = 'ootpoot'
end
passthrough '/**/*'
EOS
Nanoc::CLI.run(%w[compile])
end
example do
e... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1145_spec.rb | nanoc/spec/nanoc/regressions/gh_1145_spec.rb | # frozen_string_literal: true
describe 'GH-1145', :site, :stdio do
before do
File.write('content/foo.txt', 'asdf')
File.write('Rules', <<~EOS)
compile '/**/*' do
filter :erb
write '/last.html'
end
EOS
end
it 'detects missing output file of non-default rep' do
expect ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_970a_spec.rb | nanoc/spec/nanoc/regressions/gh_970a_spec.rb | # frozen_string_literal: true
describe 'GH-970 (show-rules)', :site, :stdio do
before do
File.write('content/foo.md', 'foo')
File.write('Rules', <<~EOS)
compile '/foo.*' do
write '/donkey.html'
end
EOS
end
it 'shows reps' do
expect { Nanoc::CLI.run(%w[show-rules --no-color])... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_841_spec.rb | nanoc/spec/nanoc/regressions/gh_841_spec.rb | # frozen_string_literal: true
describe 'GH-841', :site, :stdio do
before do
File.write('content/foo.md', 'stuff')
File.write('Rules', <<EOS)
preprocess do
items.delete_if { |_| true }
end
EOS
end
it 'preprocesses before running the check' do # rubocop:disable RSpec/NoExpectationExample
Nano... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_913_spec.rb | nanoc/spec/nanoc/regressions/gh_913_spec.rb | # frozen_string_literal: true
describe 'GH-913', :site, :stdio do
before do
File.write('content/hello.html', 'hi!')
File.write('Rules', <<EOS)
postprocess do
items.map(&:compiled_content)
end
compile '/**/*' do
write item.identifier.without_ext + '.html'
end
layout '/foo.*', :erb
EOS
e... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1374_spec.rb | nanoc/spec/nanoc/regressions/gh_1374_spec.rb | # frozen_string_literal: true
describe 'GH-1374', :site, :stdio do
before do
FileUtils.mkdir_p('content')
File.write('content/test.md', 'hello')
File.write('Rules', <<~EOS)
compile '/*' do
write nil
end
passthrough '/*'
EOS
end
example do
expect { Nanoc::CLI.run([... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_867_spec.rb | nanoc/spec/nanoc/regressions/gh_867_spec.rb | # frozen_string_literal: true
describe 'GH-867', :site, :stdio do
before do
File.write('content/foo.md', 'stuff')
File.write('Rules', <<EOS)
preprocess do
items.delete_if { |_| true }
end
EOS
end
it 'preprocesses before running show-data' do
expect { Nanoc::CLI.run(%w[show-data]) }.not_to o... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1323_spec.rb | nanoc/spec/nanoc/regressions/gh_1323_spec.rb | # frozen_string_literal: true
describe 'GH-1323', :site, :stdio do
before do
File.write('content/stuff.html', 'stuff')
File.write('lib/stuff.rb', <<~EOS)
Nanoc::Filter.define(:filter_gh1323) do |content, params = {}|
nil
end
EOS
File.write('Rules', <<~EOS)
compile '/**/*' ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1067_spec.rb | nanoc/spec/nanoc/regressions/gh_1067_spec.rb | # frozen_string_literal: true
describe 'GH-1067', :site, :stdio do
before do
File.write('nanoc.yaml', <<~EOS)
environments:
default:
build: dev
prod:
build: prod
EOS
File.write('content/foo.erb', 'build=<%= @config[:build] %>')
File.write('Rules', <<EOS)
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_970b_spec.rb | nanoc/spec/nanoc/regressions/gh_970b_spec.rb | # frozen_string_literal: true
describe 'GH-970 (show-data)', :site, :stdio do
before do
File.write('content/foo.md', 'foo')
File.write('content/bar.md', '<%= @items["/foo.*"].compiled_content %>')
File.write('Rules', <<~EOS)
compile '/foo.*' do
write '/foo.html'
end
compile '/... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1412_spec.rb | nanoc/spec/nanoc/regressions/gh_1412_spec.rb | # frozen_string_literal: true
describe 'GH-1412', :site, :stdio do
before do
FileUtils.mkdir_p('content')
File.write('content/a.erb', 'A <%= @items["/b.*"].compiled_content %>')
File.write('content/b.erb', 'B <%= @items["/a.*"].compiled_content %>')
FileUtils.mkdir_p('layouts')
File.write('layou... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1313_spec.rb | nanoc/spec/nanoc/regressions/gh_1313_spec.rb | # frozen_string_literal: true
describe 'GH-1313', :site, :stdio do
before do
File.write('nanoc.yaml', <<~CONFIG)
output_dir: build/bin/web/bin
prune:
auto_prune: true
exclude:
- bin
CONFIG
FileUtils.mkdir_p('build/bin/web/bin')
File.write('build/bin/web/bin/shou... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1342_spec.rb | nanoc/spec/nanoc/regressions/gh_1342_spec.rb | # frozen_string_literal: true
describe 'GH-1342', :site, :stdio do
before do
File.write('Rules', <<~EOS)
preprocess do
items.create('<%= "hi!" %>', {}, '/hello.html')
end
compile '/*' do
filter :erb
write ext: 'html'
end
postprocess do
@items.each(&... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1554_spec.rb | nanoc/spec/nanoc/regressions/gh_1554_spec.rb | # frozen_string_literal: true
describe 'GH-1554', :site, :stdio do
example do
FileUtils.mkdir_p('content')
FileUtils.mkdir_p('content/parts')
File.write('content/main.erb', 'Stuff')
File.write('content/parts/a.txt', "---\ndraft: false\n---\nPart A")
File.write('content/parts/b.txt', "---\ndraft:... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1102_spec.rb | nanoc/spec/nanoc/regressions/gh_1102_spec.rb | # frozen_string_literal: true
describe 'GH-1102', :site, :stdio do
before do
File.write('content/index.html', '<%= "things" %>')
File.write('Rules', <<~EOS)
compile '/**/*.html' do
filter :erb
write item.identifier.to_s
end
EOS
Nanoc::CLI.run(%w[compile])
end
it 'do... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1134_spec.rb | nanoc/spec/nanoc/regressions/gh_1134_spec.rb | # frozen_string_literal: true
describe 'GH-1134', :site, :stdio do
before do
File.write('content/foo.txt', 'asdf')
File.write('Rules', <<~EOS)
compile '/**/*' do
write '/first.html'
filter :erb
write '/last.html'
end
EOS
end
it 'detects missing output file of non... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1319_spec.rb | nanoc/spec/nanoc/regressions/gh_1319_spec.rb | # frozen_string_literal: true
describe 'GH-1319', :site, :stdio do
before do
File.write('content/stuff.html', '<gcse:search>abc</gcse:search>')
File.write('Rules', <<~EOS)
compile '/**/*' do
filter :relativize_paths, type: :html
write ext: 'html'
end
EOS
Nanoc::CLI.run(%... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1082a_spec.rb | nanoc/spec/nanoc/regressions/gh_1082a_spec.rb | # frozen_string_literal: true
describe 'GH-1082', :site, :stdio do
before do
File.write('content/a.erb', '<%= @items["/b.*"].binary? %>')
File.write('content/b.erb', 'stuff')
File.write('Rules', <<EOS)
compile '/*' do
filter :erb
write item.identifier.without_ext + '.txt'
end
EOS
end
it... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_942_spec.rb | nanoc/spec/nanoc/regressions/gh_942_spec.rb | # frozen_string_literal: true
describe 'GH-942', :site, :stdio do
before do
File.write('content/foo.md', 'Foo!')
File.write('Rules', <<EOS)
compile '/foo.*' do
write '/parent/foo'
end
EOS
File.open('nanoc.yaml', 'w') do |io|
io << 'prune:' << "\n"
io << ' auto_prune: true' << "\n"
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_804_spec.rb | nanoc/spec/nanoc/regressions/gh_804_spec.rb | # frozen_string_literal: true
describe 'GH-804', :site, :stdio do
before do
File.write('content/item.md', 'Stuff!')
File.write('Rules', <<EOS)
compile '/**/*' do
filter :erb if item[:dynamic]
write item.identifier.without_ext + '.html'
end
EOS
File.write('Checks', <<~EOS)
check :donkey... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_948_spec.rb | nanoc/spec/nanoc/regressions/gh_948_spec.rb | # frozen_string_literal: true
describe 'GH-948', :site, :stdio do
before do
File.write('content/foo.md', 'Foo!')
File.open('nanoc.yaml', 'w') do |io|
io << 'prune:' << "\n"
io << ' auto_prune: true' << "\n"
end
FileUtils.rm_rf('output')
end
it 'does not crash when output dir is no... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_833_spec.rb | nanoc/spec/nanoc/regressions/gh_833_spec.rb | # frozen_string_literal: true
describe 'GH-833', :site, :stdio do
before do
File.write('content/foo.md', 'stuff')
File.write('Rules', <<EOS)
compile '/**/*' do
write item.identifier.without_ext + '.txt'
end
EOS
end
it 'runs show-data without crashing' do # rubocop:disable RSpec/NoExpectationExam... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_776_spec.rb | nanoc/spec/nanoc/regressions/gh_776_spec.rb | # frozen_string_literal: true
describe 'GH-776', :site do
before do
File.write('content/donkey.md', 'Donkey!')
File.write('Rules', <<~EOS)
compile '/donkey.*' do
filter :erb
snapshot :secret, path: '/donkey-secret.html'
write '/donkey.html'
end
layout '/foo.*', :er... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1035_spec.rb | nanoc/spec/nanoc/regressions/gh_1035_spec.rb | # frozen_string_literal: true
describe 'GH-1035', :site, :stdio do
before do
File.write('content/foo.md', '[<%= @items["/bar.*"].compiled_content(snapshot: :raw) %>]')
File.write('content/bar.md', 'I am bar!')
File.write('lib/stuff.rb', <<~EOS)
Class.new(Nanoc::Filter) do
identifier :gh_10... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1185_spec.rb | nanoc/spec/nanoc/regressions/gh_1185_spec.rb | # frozen_string_literal: true
describe 'GH-1185', :site, :stdio do
before do
File.write('content/foo.html', 'stuff')
File.write('Rules', <<~EOS)
preprocess do
@items['/foo.*'].identifier = '/bar.html'
end
compile '/**/*' do
filter :erb
write ext: 'html'
end
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1022_spec.rb | nanoc/spec/nanoc/regressions/gh_1022_spec.rb | # frozen_string_literal: true
describe 'GH-1022', :site, :stdio do
before do
File.write('content/ubuntu-16.10-server-amd64.iso.txt', 'torrent contents')
File.write('content/ubuntu-16.10-server-amd64.iso.yaml', 'distro: Ubuntu')
File.write('layouts/default.erb', '<%= @item[:distro] %> / <%= yield %>')
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1328_spec.rb | nanoc/spec/nanoc/regressions/gh_1328_spec.rb | # frozen_string_literal: true
describe 'GH-1328', :site, :stdio do
before do
FileUtils.mkdir_p('content')
File.write('content/foo.md', <<~EOS)
<html>
<head>
<title>hi</title>
</head>
<body>
<a href="/b0rk">bork bork</a>
</body>
</html>
EOS
... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1352_spec.rb | nanoc/spec/nanoc/regressions/gh_1352_spec.rb | # frozen_string_literal: true
describe 'GH-1352', :site, :stdio do
before do
File.write('nanoc.yaml', <<~EOS)
environments:
default:
foo: 'bar'
xxx:
EOS
end
example do
expect { Nanoc::CLI.run([]) }.to raise_error(JsonSchema::Error)
end
end
| ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1572_spec.rb | nanoc/spec/nanoc/regressions/gh_1572_spec.rb | # frozen_string_literal: true
describe 'GH-1572', :site, :stdio do
example do
FileUtils.mkdir_p('content')
allow_any_instance_of(Nanoc::Core::BinaryCompiledContentCache)
.to receive(:use_clonefile?)
.and_return(false)
File.write('content/repro.jpg', '<data>')
File.chmod(0o400, 'content/... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1015_spec.rb | nanoc/spec/nanoc/regressions/gh_1015_spec.rb | # frozen_string_literal: true
describe 'GH-1015', :site, :stdio do
before do
File.write('content/foo.md', 'I am foo!')
File.write('Rules', <<EOS)
compile '/foo.*' do
filter :erb, stuff: self
write 'foo.html'
end
EOS
end
it 'errors' do
expect { Nanoc::CLI.run(%w[compile --verbose]) }.to ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1082d_spec.rb | nanoc/spec/nanoc/regressions/gh_1082d_spec.rb | # frozen_string_literal: true
describe 'GH-1082', :site, :stdio do
before do
File.write('content/a.erb', '<%= @item.reps[:default].binary? %>')
File.write('Rules', <<EOS)
compile '/*' do
filter :erb
write item.identifier.without_ext + '.txt'
end
EOS
end
it 'does not require any items to be ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_951_spec.rb | nanoc/spec/nanoc/regressions/gh_951_spec.rb | # frozen_string_literal: true
describe 'GH-951', :site, :stdio do
before do
File.write('content/foo.md', 'Foo!')
File.open('nanoc.yaml', 'w') do |io|
io << 'string_pattern_type: legacy' << "\n"
end
File.write('Rules', <<EOS)
passthrough '/foo.md'
EOS
end
it 'copies foo.md' do
Nanoc... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1037b_spec.rb | nanoc/spec/nanoc/regressions/gh_1037b_spec.rb | # frozen_string_literal: true
describe 'GH-1037', :site, :stdio do
before do
File.write('content/foo.png', 'stuff')
File.write('Rules', <<EOS)
compile '/*.png' do
write '/foo-s3cr3t.png'
end
passthrough '/*.png'
EOS
end
it 'writes one file' do
Nanoc::CLI.run(%w[compile])
expect(Dir['... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_954_spec.rb | nanoc/spec/nanoc/regressions/gh_954_spec.rb | # frozen_string_literal: true
describe 'GH-954', :site, :stdio do
before do
File.write('content/foo.md', 'foo <a href="/">root</a>')
File.write('content/bar.md', 'bar <a href="/">root</a>')
File.write('content/bar-copy.md', '<%= @items["/bar.*"].compiled_content(snapshot: :last) %>')
File.write('Rul... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_885_spec.rb | nanoc/spec/nanoc/regressions/gh_885_spec.rb | # frozen_string_literal: true
describe 'GH-885', :site, :stdio do
before do
File.write(
'content/index.html',
"<%= @items['/hello.*'].compiled_content %> - <%= Time.now.to_f %>",
)
File.write('Rules', <<EOS)
preprocess do
items.create('hi!', {}, '/hello.html')
end
compile '/**/*' ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_767_spec.rb | nanoc/spec/nanoc/regressions/gh_767_spec.rb | # frozen_string_literal: true
describe 'GH-767', :site do
before do
File.write('content/donkey.md', 'Compiled content donkey!')
File.write('Rules', <<EOS)
compile '/**/*' do
filter :erb, stuff: item.path
write '/donkey.html'
end
layout '/foo.*', :erb
EOS
end
it 'does not expose #path on ... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1082b_spec.rb | nanoc/spec/nanoc/regressions/gh_1082b_spec.rb | # frozen_string_literal: true
describe 'GH-1082', :site, :stdio do
before do
File.write('content/a.erb', '<%= @items["/b.*"].binary? %>')
File.write('content/b.dat', 'stuff')
File.write('Rules', <<EOS)
compile '/a.*' do
filter :erb
write item.identifier.without_ext + '.txt'
end
passthroug... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
nanoc/nanoc | https://github.com/nanoc/nanoc/blob/59f767805018b4fc69e0bba896309c0028d3f53e/nanoc/spec/nanoc/regressions/gh_1082c_spec.rb | nanoc/spec/nanoc/regressions/gh_1082c_spec.rb | # frozen_string_literal: true
describe 'GH-1082', :site, :stdio do
before do
File.write('content/a.erb', '<%= @items["/b.*"].reps[:default].binary? %>')
File.write('content/b.erb', '<%= @items["/a.*"].reps[:default].binary? %>')
File.write('Rules', <<EOS)
compile '/*' do
filter :erb
write item... | ruby | MIT | 59f767805018b4fc69e0bba896309c0028d3f53e | 2026-01-04T15:57:49.460670Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.