nanoc 4.4.5 → 4.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -2
- data/Gemfile.lock +37 -18
- data/NEWS.md +6 -0
- data/Rakefile +8 -20
- data/lib/nanoc/base/entities/code_snippet.rb +0 -2
- data/lib/nanoc/base/entities/item_rep.rb +4 -22
- data/lib/nanoc/base/entities/processing_actions/snapshot.rb +9 -7
- data/lib/nanoc/base/entities/rule_memory.rb +15 -7
- data/lib/nanoc/base/entities/snapshot_def.rb +2 -8
- data/lib/nanoc/base/repos/store.rb +2 -28
- data/lib/nanoc/base/services/checksummer.rb +9 -10
- data/lib/nanoc/base/services/compiler.rb +14 -16
- data/lib/nanoc/base/services/executor.rb +2 -13
- data/lib/nanoc/base/views/mixins/with_reps_view_mixin.rb +1 -1
- data/lib/nanoc/checking/checks/external_links.rb +2 -1
- data/lib/nanoc/cli/commands/compile.rb +8 -14
- data/lib/nanoc/extra/parallel_collection.rb +57 -0
- data/lib/nanoc/extra.rb +1 -0
- data/lib/nanoc/filters/mustache.rb +1 -1
- data/lib/nanoc/rule_dsl/recording_executor.rb +6 -34
- data/lib/nanoc/rule_dsl/rule_memory_calculator.rb +42 -12
- data/lib/nanoc/spec.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +1 -2
- data/spec/contributors_spec.rb +18 -0
- data/spec/nanoc/base/checksummer_spec.rb +381 -0
- data/spec/nanoc/base/compiler_spec.rb +181 -0
- data/spec/nanoc/base/entities/configuration_spec.rb +49 -0
- data/spec/nanoc/base/entities/content_spec.rb +193 -0
- data/spec/nanoc/base/entities/document_spec.rb +206 -0
- data/spec/nanoc/base/entities/identifier_spec.rb +460 -0
- data/spec/nanoc/base/entities/item_rep_spec.rb +226 -0
- data/spec/nanoc/base/entities/item_spec.rb +3 -0
- data/spec/nanoc/base/entities/layout_spec.rb +3 -0
- data/spec/nanoc/base/entities/lazy_value_spec.rb +106 -0
- data/spec/nanoc/base/entities/outdatedness_status_spec.rb +113 -0
- data/spec/nanoc/base/entities/pattern_spec.rb +125 -0
- data/spec/nanoc/base/entities/processing_action_spec.rb +9 -0
- data/spec/nanoc/base/entities/processing_actions/filter_spec.rb +18 -0
- data/spec/nanoc/base/entities/processing_actions/layout_spec.rb +18 -0
- data/spec/nanoc/base/entities/processing_actions/snapshot_spec.rb +32 -0
- data/spec/nanoc/base/entities/props_spec.rb +195 -0
- data/spec/nanoc/base/entities/rule_memory_spec.rb +131 -0
- data/spec/nanoc/base/entities/site_spec.rb +73 -0
- data/spec/nanoc/base/feature_spec.rb +107 -0
- data/spec/nanoc/base/filter_spec.rb +99 -0
- data/spec/nanoc/base/item_rep_writer_spec.rb +131 -0
- data/spec/nanoc/base/plugin_registry_spec.rb +29 -0
- data/spec/nanoc/base/repos/checksum_store_spec.rb +133 -0
- data/spec/nanoc/base/repos/compiled_content_cache_spec.rb +55 -0
- data/spec/nanoc/base/repos/config_loader_spec.rb +243 -0
- data/spec/nanoc/base/repos/dependency_store_spec.rb +195 -0
- data/spec/nanoc/base/repos/site_loader_spec.rb +214 -0
- data/spec/nanoc/base/services/dependency_tracker_spec.rb +238 -0
- data/spec/nanoc/base/services/executor_spec.rb +495 -0
- data/spec/nanoc/base/services/item_rep_router_spec.rb +134 -0
- data/spec/nanoc/base/services/item_rep_selector_spec.rb +169 -0
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +370 -0
- data/spec/nanoc/base/services/outdatedness_rules_spec.rb +432 -0
- data/spec/nanoc/base/services/pruner_spec.rb +105 -0
- data/spec/nanoc/base/services/temp_filename_factory_spec.rb +87 -0
- data/spec/nanoc/base/views/config_view_spec.rb +96 -0
- data/spec/nanoc/base/views/document_view_spec.rb +332 -0
- data/spec/nanoc/base/views/identifiable_collection_view_spec.rb +190 -0
- data/spec/nanoc/base/views/item_collection_with_reps_view_spec.rb +18 -0
- data/spec/nanoc/base/views/item_collection_without_reps_view_spec.rb +18 -0
- data/spec/nanoc/base/views/item_rep_collection_view_spec.rb +143 -0
- data/spec/nanoc/base/views/item_rep_view_spec.rb +265 -0
- data/spec/nanoc/base/views/item_view_spec.rb +341 -0
- data/spec/nanoc/base/views/layout_collection_view_spec.rb +18 -0
- data/spec/nanoc/base/views/layout_view_spec.rb +14 -0
- data/spec/nanoc/base/views/mutable_config_view_spec.rb +16 -0
- data/spec/nanoc/base/views/mutable_document_view_spec.rb +92 -0
- data/spec/nanoc/base/views/mutable_identifiable_collection_view_spec.rb +36 -0
- data/spec/nanoc/base/views/mutable_item_collection_view_spec.rb +49 -0
- data/spec/nanoc/base/views/mutable_item_view_spec.rb +22 -0
- data/spec/nanoc/base/views/mutable_layout_collection_view_spec.rb +49 -0
- data/spec/nanoc/base/views/mutable_layout_view_spec.rb +13 -0
- data/spec/nanoc/base/views/post_compile_item_rep_collection_view_spec.rb +4 -0
- data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +137 -0
- data/spec/nanoc/base/views/post_compile_item_view_spec.rb +56 -0
- data/spec/nanoc/cli/commands/compile/file_action_printer_spec.rb +76 -0
- data/spec/nanoc/cli/commands/compile/timing_recorder_spec.rb +66 -0
- data/spec/nanoc/cli/commands/compile_spec.rb +64 -0
- data/spec/nanoc/cli/commands/deploy_spec.rb +327 -0
- data/spec/nanoc/cli/commands/shell_spec.rb +54 -0
- data/spec/nanoc/cli/commands/show_data_spec.rb +126 -0
- data/spec/nanoc/cli/commands/show_rules_spec.rb +112 -0
- data/spec/nanoc/cli/commands/view_spec.rb +58 -0
- data/spec/nanoc/data_sources/filesystem_spec.rb +56 -0
- data/spec/nanoc/deploying/fog_spec.rb +193 -0
- data/spec/nanoc/extra/parallel_collection_spec.rb +108 -0
- data/spec/nanoc/filters/colorize_syntax/rouge_spec.rb +195 -0
- data/spec/nanoc/filters/less_spec.rb +120 -0
- data/spec/nanoc/helpers/blogging_spec.rb +216 -0
- data/spec/nanoc/helpers/breadcrumbs_spec.rb +133 -0
- data/spec/nanoc/helpers/capturing_spec.rb +181 -0
- data/spec/nanoc/helpers/child_parent_spec.rb +105 -0
- data/spec/nanoc/helpers/filtering_spec.rb +72 -0
- data/spec/nanoc/helpers/html_escape_spec.rb +35 -0
- data/spec/nanoc/helpers/link_to_spec.rb +275 -0
- data/spec/nanoc/helpers/rendering_spec.rb +141 -0
- data/spec/nanoc/helpers/tagging_spec.rb +104 -0
- data/spec/nanoc/helpers/text_spec.rb +58 -0
- data/spec/nanoc/integration/outdatedness_integration_spec.rb +208 -0
- data/spec/nanoc/regressions/gh_1015_spec.rb +17 -0
- data/spec/nanoc/regressions/gh_1031_spec.rb +54 -0
- data/spec/nanoc/regressions/gh_1035_spec.rb +33 -0
- data/spec/nanoc/regressions/gh_1040_spec.rb +22 -0
- data/spec/nanoc/regressions/gh_761_spec.rb +23 -0
- data/spec/nanoc/regressions/gh_767_spec.rb +19 -0
- data/spec/nanoc/regressions/gh_769_spec.rb +30 -0
- data/spec/nanoc/regressions/gh_776_spec.rb +43 -0
- data/spec/nanoc/regressions/gh_787_spec.rb +19 -0
- data/spec/nanoc/regressions/gh_795_spec.rb +19 -0
- data/spec/nanoc/regressions/gh_804_spec.rb +26 -0
- data/spec/nanoc/regressions/gh_807_spec.rb +17 -0
- data/spec/nanoc/regressions/gh_809_spec.rb +17 -0
- data/spec/nanoc/regressions/gh_813_spec.rb +22 -0
- data/spec/nanoc/regressions/gh_815_spec.rb +18 -0
- data/spec/nanoc/regressions/gh_828_spec.rb +23 -0
- data/spec/nanoc/regressions/gh_833_spec.rb +14 -0
- data/spec/nanoc/regressions/gh_841_spec.rb +15 -0
- data/spec/nanoc/regressions/gh_867_spec.rb +15 -0
- data/spec/nanoc/regressions/gh_882_spec.rb +29 -0
- data/spec/nanoc/regressions/gh_885_spec.rb +30 -0
- data/spec/nanoc/regressions/gh_891_spec.rb +26 -0
- data/spec/nanoc/regressions/gh_913_spec.rb +24 -0
- data/spec/nanoc/regressions/gh_928_spec.rb +5 -0
- data/spec/nanoc/regressions/gh_937_spec.rb +25 -0
- data/spec/nanoc/regressions/gh_942_spec.rb +21 -0
- data/spec/nanoc/regressions/gh_947_spec.rb +21 -0
- data/spec/nanoc/regressions/gh_948_spec.rb +16 -0
- data/spec/nanoc/regressions/gh_951_spec.rb +19 -0
- data/spec/nanoc/regressions/gh_954_spec.rb +33 -0
- data/spec/nanoc/regressions/gh_970a_spec.rb +17 -0
- data/spec/nanoc/regressions/gh_970b_spec.rb +50 -0
- data/spec/nanoc/regressions/gh_974_spec.rb +17 -0
- data/spec/nanoc/regressions/gh_981_spec.rb +21 -0
- data/spec/nanoc/rule_dsl/recording_executor_spec.rb +142 -0
- data/spec/nanoc/rule_dsl/rule_context_spec.rb +177 -0
- data/spec/nanoc/rule_dsl/rule_memory_calculator_spec.rb +233 -0
- data/spec/nanoc/rule_dsl/rules_collection_spec.rb +299 -0
- data/spec/regression_filenames_spec.rb +16 -0
- data/spec/spec_helper.rb +173 -0
- data/test/base/core_ext/array_spec.rb +2 -0
- data/test/base/core_ext/hash_spec.rb +2 -0
- data/test/base/core_ext/string_spec.rb +2 -0
- data/test/base/test_code_snippet.rb +2 -0
- data/test/base/test_compiler.rb +2 -0
- data/test/base/test_context.rb +4 -2
- data/test/base/test_data_source.rb +2 -0
- data/test/base/test_dependency_tracker.rb +2 -0
- data/test/base/test_directed_graph.rb +2 -0
- data/test/base/test_filter.rb +7 -5
- data/test/base/test_item.rb +2 -0
- data/test/base/test_item_array.rb +3 -1
- data/test/base/test_layout.rb +2 -0
- data/test/base/test_memoization.rb +2 -0
- data/test/base/test_notification_center.rb +2 -0
- data/test/base/test_outdatedness_checker.rb +2 -0
- data/test/base/test_plugin.rb +2 -0
- data/test/base/test_site.rb +2 -0
- data/test/base/test_store.rb +2 -0
- data/test/checking/checks/test_css.rb +2 -0
- data/test/checking/checks/test_external_links.rb +4 -2
- data/test/checking/checks/test_html.rb +2 -0
- data/test/checking/checks/test_internal_links.rb +5 -3
- data/test/checking/checks/test_mixed_content.rb +2 -0
- data/test/checking/checks/test_stale.rb +2 -0
- data/test/checking/test_check.rb +2 -0
- data/test/checking/test_dsl.rb +2 -0
- data/test/checking/test_runner.rb +2 -0
- data/test/cli/commands/test_check.rb +2 -0
- data/test/cli/commands/test_compile.rb +2 -0
- data/test/cli/commands/test_create_site.rb +2 -0
- data/test/cli/commands/test_help.rb +2 -0
- data/test/cli/commands/test_info.rb +2 -0
- data/test/cli/commands/test_prune.rb +2 -0
- data/test/cli/test_cleaning_stream.rb +2 -0
- data/test/cli/test_cli.rb +11 -9
- data/test/cli/test_error_handler.rb +2 -0
- data/test/cli/test_logger.rb +2 -0
- data/test/data_sources/test_filesystem.rb +8 -6
- data/test/data_sources/test_filesystem_tools.rb +2 -0
- data/test/deploying/test_fog.rb +2 -0
- data/test/deploying/test_rsync.rb +4 -2
- data/test/extra/core_ext/test_pathname.rb +2 -0
- data/test/extra/core_ext/test_time.rb +2 -0
- data/test/extra/test_link_collector.rb +2 -0
- data/test/extra/test_piper.rb +2 -0
- data/test/filters/colorize_syntax/test_coderay.rb +2 -0
- data/test/filters/colorize_syntax/test_common.rb +2 -0
- data/test/filters/colorize_syntax/test_pygmentize.rb +2 -0
- data/test/filters/colorize_syntax/test_pygments.rb +2 -0
- data/test/filters/colorize_syntax/test_simon.rb +2 -0
- data/test/filters/test_asciidoc.rb +2 -0
- data/test/filters/test_bluecloth.rb +2 -0
- data/test/filters/test_coffeescript.rb +2 -0
- data/test/filters/test_erb.rb +7 -5
- data/test/filters/test_erubis.rb +6 -4
- data/test/filters/test_haml.rb +7 -5
- data/test/filters/test_handlebars.rb +2 -0
- data/test/filters/test_kramdown.rb +2 -0
- data/test/filters/test_markaby.rb +2 -0
- data/test/filters/test_maruku.rb +2 -0
- data/test/filters/test_mustache.rb +4 -2
- data/test/filters/test_pandoc.rb +2 -0
- data/test/filters/test_rainpress.rb +2 -0
- data/test/filters/test_rdiscount.rb +2 -0
- data/test/filters/test_rdoc.rb +2 -0
- data/test/filters/test_redcarpet.rb +2 -0
- data/test/filters/test_redcloth.rb +2 -0
- data/test/filters/test_relativize_paths.rb +2 -0
- data/test/filters/test_rubypants.rb +2 -0
- data/test/filters/test_sass.rb +4 -2
- data/test/filters/test_slim.rb +4 -2
- data/test/filters/test_typogruby.rb +2 -0
- data/test/filters/test_uglify_js.rb +2 -0
- data/test/filters/test_xsl.rb +2 -0
- data/test/filters/test_yui_compressor.rb +5 -3
- data/test/helpers/test_blogging.rb +2 -0
- data/test/helpers/test_capturing.rb +2 -0
- data/test/helpers/test_link_to.rb +2 -0
- data/test/helpers/test_xml_sitemap.rb +2 -0
- data/test/rule_dsl/test_action_provider.rb +2 -0
- data/test/rule_dsl/test_compiler_dsl.rb +6 -4
- data/test/rule_dsl/test_rule.rb +2 -0
- data/test/rule_dsl/test_rules_collection.rb +2 -0
- data/test/test_gem.rb +2 -0
- metadata +124 -17
- data/test/base/test_item_rep.rb +0 -156
data/test/deploying/test_fog.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Deploying::Deployers::RsyncTest < Nanoc::TestCase
|
2
4
|
def test_run_without_dst
|
3
5
|
# Create deployer
|
@@ -24,7 +26,7 @@ class Nanoc::Deploying::Deployers::RsyncTest < Nanoc::TestCase
|
|
24
26
|
# Create deployer
|
25
27
|
rsync = Nanoc::Deploying::Deployers::Rsync.new(
|
26
28
|
'output/',
|
27
|
-
|
29
|
+
dst: 'asdf/',
|
28
30
|
)
|
29
31
|
|
30
32
|
# Mock run_shell_cmd
|
@@ -45,7 +47,7 @@ class Nanoc::Deploying::Deployers::RsyncTest < Nanoc::TestCase
|
|
45
47
|
# Create deployer
|
46
48
|
rsync = Nanoc::Deploying::Deployers::Rsync.new(
|
47
49
|
'output',
|
48
|
-
|
50
|
+
dst: 'asdf',
|
49
51
|
)
|
50
52
|
|
51
53
|
# Mock run_shell_cmd
|
data/test/extra/test_piper.rb
CHANGED
data/test/filters/test_erb.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::ERBTest < Nanoc::TestCase
|
2
4
|
def test_filter_with_instance_variable
|
3
5
|
# Create filter
|
4
|
-
filter = ::Nanoc::Filters::ERB.new(
|
6
|
+
filter = ::Nanoc::Filters::ERB.new(location: 'a cheap motel')
|
5
7
|
|
6
8
|
# Run filter
|
7
9
|
result = filter.setup_and_run('<%= "I was hiding in #{@location}." %>')
|
@@ -10,7 +12,7 @@ class Nanoc::Filters::ERBTest < Nanoc::TestCase
|
|
10
12
|
|
11
13
|
def test_filter_with_instance_method
|
12
14
|
# Create filter
|
13
|
-
filter = ::Nanoc::Filters::ERB.new(
|
15
|
+
filter = ::Nanoc::Filters::ERB.new(location: 'a cheap motel')
|
14
16
|
|
15
17
|
# Run filter
|
16
18
|
result = filter.setup_and_run('<%= "I was hiding in #{location}." %>')
|
@@ -45,7 +47,7 @@ class Nanoc::Filters::ERBTest < Nanoc::TestCase
|
|
45
47
|
|
46
48
|
def test_filter_with_yield
|
47
49
|
# Create filter
|
48
|
-
filter = ::Nanoc::Filters::ERB.new(
|
50
|
+
filter = ::Nanoc::Filters::ERB.new(content: 'a cheap motel')
|
49
51
|
|
50
52
|
# Run filter
|
51
53
|
result = filter.setup_and_run('<%= "I was hiding in #{yield}." %>')
|
@@ -54,7 +56,7 @@ class Nanoc::Filters::ERBTest < Nanoc::TestCase
|
|
54
56
|
|
55
57
|
def test_filter_with_yield_without_content
|
56
58
|
# Create filter
|
57
|
-
filter = ::Nanoc::Filters::ERB.new(
|
59
|
+
filter = ::Nanoc::Filters::ERB.new(location: 'a cheap motel')
|
58
60
|
|
59
61
|
# Run filter
|
60
62
|
assert_raises LocalJumpError do
|
@@ -83,7 +85,7 @@ class Nanoc::Filters::ERBTest < Nanoc::TestCase
|
|
83
85
|
|
84
86
|
def test_trim_mode
|
85
87
|
# Set up
|
86
|
-
filter = ::Nanoc::Filters::ERB.new(
|
88
|
+
filter = ::Nanoc::Filters::ERB.new(location: 'a cheap motel')
|
87
89
|
$trim_mode_works = false
|
88
90
|
|
89
91
|
# Without
|
data/test/filters/test_erubis.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::ErubisTest < Nanoc::TestCase
|
2
4
|
def test_filter_with_instance_variable
|
3
5
|
if_have 'erubis' do
|
4
6
|
# Create filter
|
5
|
-
filter = ::Nanoc::Filters::Erubis.new(
|
7
|
+
filter = ::Nanoc::Filters::Erubis.new(location: 'a cheap motel')
|
6
8
|
|
7
9
|
# Run filter
|
8
10
|
result = filter.setup_and_run('<%= "I was hiding in #{@location}." %>')
|
@@ -13,7 +15,7 @@ class Nanoc::Filters::ErubisTest < Nanoc::TestCase
|
|
13
15
|
def test_filter_with_instance_method
|
14
16
|
if_have 'erubis' do
|
15
17
|
# Create filter
|
16
|
-
filter = ::Nanoc::Filters::Erubis.new(
|
18
|
+
filter = ::Nanoc::Filters::Erubis.new(location: 'a cheap motel')
|
17
19
|
|
18
20
|
# Run filter
|
19
21
|
result = filter.setup_and_run('<%= "I was hiding in #{location}." %>')
|
@@ -42,7 +44,7 @@ class Nanoc::Filters::ErubisTest < Nanoc::TestCase
|
|
42
44
|
def test_filter_with_yield
|
43
45
|
if_have 'erubis' do
|
44
46
|
# Create filter
|
45
|
-
filter = ::Nanoc::Filters::Erubis.new(
|
47
|
+
filter = ::Nanoc::Filters::Erubis.new(content: 'a cheap motel')
|
46
48
|
|
47
49
|
# Run filter
|
48
50
|
result = filter.setup_and_run('<%= "I was hiding in #{yield}." %>')
|
@@ -53,7 +55,7 @@ class Nanoc::Filters::ErubisTest < Nanoc::TestCase
|
|
53
55
|
def test_filter_with_yield_without_content
|
54
56
|
if_have 'erubis' do
|
55
57
|
# Create filter
|
56
|
-
filter = ::Nanoc::Filters::Erubis.new(
|
58
|
+
filter = ::Nanoc::Filters::Erubis.new(location: 'a cheap motel')
|
57
59
|
|
58
60
|
# Run filter
|
59
61
|
assert_raises LocalJumpError do
|
data/test/filters/test_haml.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::HamlTest < Nanoc::TestCase
|
2
4
|
def test_filter
|
3
5
|
if_have 'haml' do
|
4
6
|
# Create filter
|
5
|
-
filter = ::Nanoc::Filters::Haml.new(
|
7
|
+
filter = ::Nanoc::Filters::Haml.new(question: 'Is this the Payne residence?')
|
6
8
|
|
7
9
|
# Run filter (no assigns)
|
8
10
|
result = filter.setup_and_run('%html')
|
@@ -21,7 +23,7 @@ class Nanoc::Filters::HamlTest < Nanoc::TestCase
|
|
21
23
|
def test_filter_with_params
|
22
24
|
if_have 'haml' do
|
23
25
|
# Create filter
|
24
|
-
filter = ::Nanoc::Filters::Haml.new(
|
26
|
+
filter = ::Nanoc::Filters::Haml.new(foo: 'bar')
|
25
27
|
|
26
28
|
# Check with HTML5
|
27
29
|
result = filter.setup_and_run('%img', format: :html5)
|
@@ -36,7 +38,7 @@ class Nanoc::Filters::HamlTest < Nanoc::TestCase
|
|
36
38
|
def test_filter_error
|
37
39
|
if_have 'haml' do
|
38
40
|
# Create filter
|
39
|
-
filter = ::Nanoc::Filters::Haml.new(
|
41
|
+
filter = ::Nanoc::Filters::Haml.new(foo: 'bar')
|
40
42
|
|
41
43
|
# Run filter
|
42
44
|
raised = false
|
@@ -54,7 +56,7 @@ class Nanoc::Filters::HamlTest < Nanoc::TestCase
|
|
54
56
|
def test_filter_with_yield
|
55
57
|
if_have 'haml' do
|
56
58
|
# Create filter
|
57
|
-
filter = ::Nanoc::Filters::Haml.new(
|
59
|
+
filter = ::Nanoc::Filters::Haml.new(content: 'Is this the Payne residence?')
|
58
60
|
|
59
61
|
# Run filter
|
60
62
|
result = filter.setup_and_run('%p= yield')
|
@@ -65,7 +67,7 @@ class Nanoc::Filters::HamlTest < Nanoc::TestCase
|
|
65
67
|
def test_filter_with_yield_without_content
|
66
68
|
if_have 'haml' do
|
67
69
|
# Create filter
|
68
|
-
filter = ::Nanoc::Filters::Haml.new(
|
70
|
+
filter = ::Nanoc::Filters::Haml.new(location: 'Is this the Payne residence?')
|
69
71
|
|
70
72
|
# Run filter
|
71
73
|
assert_raises LocalJumpError do
|
data/test/filters/test_maruku.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::MustacheTest < Nanoc::TestCase
|
2
4
|
def test_filter
|
3
5
|
if_have 'mustache' do
|
@@ -9,7 +11,7 @@ class Nanoc::Filters::MustacheTest < Nanoc::TestCase
|
|
9
11
|
)
|
10
12
|
|
11
13
|
# Create filter
|
12
|
-
filter = ::Nanoc::Filters::Mustache.new(
|
14
|
+
filter = ::Nanoc::Filters::Mustache.new(item: item)
|
13
15
|
|
14
16
|
# Run filter
|
15
17
|
result = filter.setup_and_run('The protagonist of {{title}} is {{protagonist}}.')
|
@@ -28,7 +30,7 @@ class Nanoc::Filters::MustacheTest < Nanoc::TestCase
|
|
28
30
|
|
29
31
|
# Create filter
|
30
32
|
filter = ::Nanoc::Filters::Mustache.new(
|
31
|
-
|
33
|
+
content: 'No Payne No Gayne', item: item,
|
32
34
|
)
|
33
35
|
|
34
36
|
# Run filter
|
data/test/filters/test_pandoc.rb
CHANGED
data/test/filters/test_rdoc.rb
CHANGED
data/test/filters/test_sass.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::SassTest < Nanoc::TestCase
|
2
4
|
def setup
|
3
5
|
super
|
@@ -12,7 +14,7 @@ class Nanoc::Filters::SassTest < Nanoc::TestCase
|
|
12
14
|
def test_filter
|
13
15
|
if_have 'sass' do
|
14
16
|
# Get filter
|
15
|
-
filter = create_filter(
|
17
|
+
filter = create_filter(foo: 'bar')
|
16
18
|
|
17
19
|
# Run filter
|
18
20
|
result = filter.setup_and_run(".foo #bar\n color: #f00")
|
@@ -23,7 +25,7 @@ class Nanoc::Filters::SassTest < Nanoc::TestCase
|
|
23
25
|
def test_filter_with_params
|
24
26
|
if_have 'sass' do
|
25
27
|
# Create filter
|
26
|
-
filter = create_filter(
|
28
|
+
filter = create_filter(foo: 'bar')
|
27
29
|
|
28
30
|
# Check with compact
|
29
31
|
result = filter.setup_and_run(".foo #bar\n color: #f00", style: 'compact')
|
data/test/filters/test_slim.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::SlimTest < Nanoc::TestCase
|
2
4
|
def test_filter
|
3
5
|
if_have 'slim' do
|
4
6
|
# Create filter
|
5
|
-
filter = ::Nanoc::Filters::Slim.new(
|
7
|
+
filter = ::Nanoc::Filters::Slim.new(rabbit: 'The rabbit is on the branch.')
|
6
8
|
|
7
9
|
# Run filter (no assigns)
|
8
10
|
result = filter.setup_and_run('html')
|
@@ -20,7 +22,7 @@ class Nanoc::Filters::SlimTest < Nanoc::TestCase
|
|
20
22
|
|
21
23
|
def test_filter_with_yield
|
22
24
|
if_have 'slim' do
|
23
|
-
filter = ::Nanoc::Filters::Slim.new(
|
25
|
+
filter = ::Nanoc::Filters::Slim.new(content: 'The rabbit is on the branch.')
|
24
26
|
|
25
27
|
result = filter.setup_and_run('p = yield')
|
26
28
|
assert_equal('<p>The rabbit is on the branch.</p>', result)
|
data/test/filters/test_xsl.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::Filters::YUICompressorTest < Nanoc::TestCase
|
2
4
|
def test_filter_javascript
|
3
5
|
if_have 'yuicompressor' do
|
@@ -13,10 +15,10 @@ class Nanoc::Filters::YUICompressorTest < Nanoc::TestCase
|
|
13
15
|
}
|
14
16
|
JAVASCRIPT
|
15
17
|
|
16
|
-
result = filter.setup_and_run(sample_js,
|
18
|
+
result = filter.setup_and_run(sample_js, type: 'js', munge: true)
|
17
19
|
assert_match 'function factorial(c){var a=1;for(var b=2;b<=c;b++){a*=b}return a};', result
|
18
20
|
|
19
|
-
result = filter.setup_and_run(sample_js,
|
21
|
+
result = filter.setup_and_run(sample_js, type: 'js', munge: false)
|
20
22
|
assert_match 'function factorial(n){var result=1;for(var i=2;i<=n;i++){result*=i}return result};', result
|
21
23
|
end
|
22
24
|
end
|
@@ -31,7 +33,7 @@ class Nanoc::Filters::YUICompressorTest < Nanoc::TestCase
|
|
31
33
|
}
|
32
34
|
CSS
|
33
35
|
|
34
|
-
result = filter.setup_and_run(sample_css,
|
36
|
+
result = filter.setup_and_run(sample_css, type: 'css')
|
35
37
|
assert_match '*{margin:0}', result
|
36
38
|
end
|
37
39
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
1
3
|
class Nanoc::RuleDSL::CompilerDSLTest < Nanoc::TestCase
|
2
4
|
def test_compile
|
3
5
|
# TODO: implement
|
@@ -290,7 +292,7 @@ EOS
|
|
290
292
|
end
|
291
293
|
|
292
294
|
def test_create_pattern_with_string_with_glob_string_pattern_type
|
293
|
-
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil,
|
295
|
+
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, string_pattern_type: 'glob')
|
294
296
|
|
295
297
|
pattern = compiler_dsl.create_pattern('/foo/*')
|
296
298
|
assert pattern.match?('/foo/aaaa')
|
@@ -299,14 +301,14 @@ EOS
|
|
299
301
|
end
|
300
302
|
|
301
303
|
def test_create_pattern_with_regex
|
302
|
-
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil,
|
304
|
+
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, string_pattern_type: 'glob')
|
303
305
|
|
304
306
|
pattern = compiler_dsl.create_pattern(%r{\A/foo/a*/})
|
305
307
|
assert pattern.match?('/foo/aaaa/')
|
306
308
|
end
|
307
309
|
|
308
310
|
def test_create_pattern_with_string_with_unknown_string_pattern_type
|
309
|
-
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil,
|
311
|
+
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, string_pattern_type: 'donkey')
|
310
312
|
|
311
313
|
err = assert_raises(Nanoc::Int::Errors::GenericTrivial) do
|
312
314
|
compiler_dsl.create_pattern('/foo/*')
|
@@ -437,7 +439,7 @@ EOS
|
|
437
439
|
|
438
440
|
def test_config
|
439
441
|
$venetian = 'unsnares'
|
440
|
-
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil,
|
442
|
+
compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, venetian: 'snares')
|
441
443
|
compiler_dsl.instance_eval { $venetian = @config[:venetian] }
|
442
444
|
assert_equal 'snares', $venetian
|
443
445
|
end
|
data/test/rule_dsl/test_rule.rb
CHANGED