nanoc 4.8.12 → 4.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +6 -0
- data/lib/nanoc/base/entities/document.rb +16 -1
- data/lib/nanoc/base/feature.rb +1 -1
- data/lib/nanoc/base/repos/action_sequence_store.rb +3 -3
- data/lib/nanoc/base/repos/checksum_store.rb +3 -3
- data/lib/nanoc/base/repos/compiled_content_cache.rb +3 -3
- data/lib/nanoc/base/repos/dependency_store.rb +3 -3
- data/lib/nanoc/base/repos/outdatedness_store.rb +3 -3
- data/lib/nanoc/base/repos/store.rb +3 -5
- data/lib/nanoc/base/services/compiler_loader.rb +5 -5
- data/lib/nanoc/base/views/mixins/mutable_document_view_mixin.rb +2 -14
- data/lib/nanoc/cli/commands/compile.rb +18 -0
- data/lib/nanoc/cli/commands/live.rb +1 -0
- data/lib/nanoc/cli/commands/view.rb +12 -35
- data/lib/nanoc/filters/redcarpet.rb +26 -65
- data/lib/nanoc/version.rb +1 -1
- metadata +2 -293
- data/.rspec +0 -3
- data/.rubocop.yml +0 -173
- data/Rakefile +0 -25
- data/nanoc.gemspec +0 -44
- data/nanoc.manifest +0 -543
- data/spec/contributors_spec.rb +0 -20
- data/spec/gem_spec.rb +0 -21
- data/spec/manifest_spec.rb +0 -22
- data/spec/nanoc/base/changes_stream_spec.rb +0 -45
- data/spec/nanoc/base/checksummer_spec.rb +0 -419
- data/spec/nanoc/base/compiler_spec.rb +0 -149
- data/spec/nanoc/base/core_ext/array_spec.rb +0 -35
- data/spec/nanoc/base/core_ext/hash_spec.rb +0 -41
- data/spec/nanoc/base/core_ext/string_spec.rb +0 -23
- data/spec/nanoc/base/directed_graph_spec.rb +0 -258
- data/spec/nanoc/base/entities/action_sequence_spec.rb +0 -297
- data/spec/nanoc/base/entities/code_snippet_spec.rb +0 -60
- data/spec/nanoc/base/entities/configuration_spec.rb +0 -132
- data/spec/nanoc/base/entities/content_spec.rb +0 -195
- data/spec/nanoc/base/entities/context_spec.rb +0 -26
- data/spec/nanoc/base/entities/document_spec.rb +0 -258
- data/spec/nanoc/base/entities/identifiable_collection_spec.rb +0 -209
- data/spec/nanoc/base/entities/identifier_spec.rb +0 -472
- data/spec/nanoc/base/entities/item_rep_spec.rb +0 -26
- data/spec/nanoc/base/entities/item_spec.rb +0 -13
- data/spec/nanoc/base/entities/layout_spec.rb +0 -13
- data/spec/nanoc/base/entities/lazy_value_spec.rb +0 -108
- data/spec/nanoc/base/entities/outdatedness_status_spec.rb +0 -115
- data/spec/nanoc/base/entities/pattern_spec.rb +0 -133
- data/spec/nanoc/base/entities/processing_action_spec.rb +0 -11
- data/spec/nanoc/base/entities/processing_actions/filter_spec.rb +0 -20
- data/spec/nanoc/base/entities/processing_actions/layout_spec.rb +0 -20
- data/spec/nanoc/base/entities/processing_actions/snapshot_spec.rb +0 -40
- data/spec/nanoc/base/entities/props_spec.rb +0 -413
- data/spec/nanoc/base/entities/site_spec.rb +0 -80
- data/spec/nanoc/base/errors/dependency_cycle_spec.rb +0 -35
- data/spec/nanoc/base/feature_spec.rb +0 -109
- data/spec/nanoc/base/filter_spec.rb +0 -166
- data/spec/nanoc/base/item_rep_writer_spec.rb +0 -140
- data/spec/nanoc/base/memoization_spec.rb +0 -108
- data/spec/nanoc/base/repos/aggregate_data_source_spec.rb +0 -87
- data/spec/nanoc/base/repos/checksum_store_spec.rb +0 -155
- data/spec/nanoc/base/repos/compiled_content_cache_spec.rb +0 -65
- data/spec/nanoc/base/repos/config_loader_spec.rb +0 -245
- data/spec/nanoc/base/repos/data_source_spec.rb +0 -95
- data/spec/nanoc/base/repos/dependency_store_spec.rb +0 -515
- data/spec/nanoc/base/repos/in_mem_data_source_spec.rb +0 -39
- data/spec/nanoc/base/repos/outdatedness_store_spec.rb +0 -72
- data/spec/nanoc/base/repos/prefixed_data_source_spec.rb +0 -39
- data/spec/nanoc/base/repos/site_loader_spec.rb +0 -264
- data/spec/nanoc/base/repos/snapshot_repo_spec.rb +0 -316
- data/spec/nanoc/base/repos/store_spec.rb +0 -93
- data/spec/nanoc/base/services/compiler/phases/abstract_spec.rb +0 -63
- data/spec/nanoc/base/services/compiler/phases/cache_spec.rb +0 -156
- data/spec/nanoc/base/services/compiler/stages/calculate_checksums_spec.rb +0 -74
- data/spec/nanoc/base/services/compiler/stages/cleanup_spec.rb +0 -88
- data/spec/nanoc/base/services/compiler/stages/compile_reps_spec.rb +0 -142
- data/spec/nanoc/base/services/compiler/stages/determine_outdatedness_spec.rb +0 -148
- data/spec/nanoc/base/services/compiler/stages/preprocess_spec.rb +0 -110
- data/spec/nanoc/base/services/dependency_tracker_spec.rb +0 -245
- data/spec/nanoc/base/services/executor_spec.rb +0 -686
- data/spec/nanoc/base/services/item_rep_router_spec.rb +0 -198
- data/spec/nanoc/base/services/item_rep_selector_spec.rb +0 -227
- data/spec/nanoc/base/services/notification_center_spec.rb +0 -25
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +0 -778
- data/spec/nanoc/base/services/outdatedness_rules_spec.rb +0 -495
- data/spec/nanoc/base/services/pruner_spec.rb +0 -116
- data/spec/nanoc/base/services/temp_filename_factory_spec.rb +0 -89
- data/spec/nanoc/base/views/basic_item_rep_collection_view_spec.rb +0 -8
- data/spec/nanoc/base/views/basic_item_rep_view_spec.rb +0 -9
- data/spec/nanoc/base/views/compilation_item_rep_collection_view_spec.rb +0 -8
- data/spec/nanoc/base/views/compilation_item_rep_view_spec.rb +0 -136
- data/spec/nanoc/base/views/config_view_spec.rb +0 -144
- data/spec/nanoc/base/views/item_collection_with_reps_view_spec.rb +0 -23
- data/spec/nanoc/base/views/item_collection_without_reps_view_spec.rb +0 -23
- data/spec/nanoc/base/views/item_view_spec.rb +0 -376
- data/spec/nanoc/base/views/layout_collection_view_spec.rb +0 -23
- data/spec/nanoc/base/views/layout_view_spec.rb +0 -18
- data/spec/nanoc/base/views/mutable_config_view_spec.rb +0 -18
- data/spec/nanoc/base/views/mutable_item_collection_view_spec.rb +0 -60
- data/spec/nanoc/base/views/mutable_item_view_spec.rb +0 -26
- data/spec/nanoc/base/views/mutable_layout_collection_view_spec.rb +0 -60
- data/spec/nanoc/base/views/mutable_layout_view_spec.rb +0 -17
- data/spec/nanoc/base/views/post_compile_item_rep_collection_view_spec.rb +0 -8
- data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +0 -216
- data/spec/nanoc/base/views/post_compile_item_view_spec.rb +0 -58
- data/spec/nanoc/base/views/support/document_view_examples.rb +0 -340
- data/spec/nanoc/base/views/support/identifiable_collection_view_examples.rb +0 -277
- data/spec/nanoc/base/views/support/item_rep_collection_view_examples.rb +0 -140
- data/spec/nanoc/base/views/support/item_rep_view_examples.rb +0 -308
- data/spec/nanoc/base/views/support/mutable_document_view_examples.rb +0 -188
- data/spec/nanoc/base/views/support/mutable_identifiable_collection_view_examples.rb +0 -44
- data/spec/nanoc/checking/runner_spec.rb +0 -26
- data/spec/nanoc/cli/command_runner_spec.rb +0 -107
- data/spec/nanoc/cli/commands/compile/abstract_spec.rb +0 -80
- data/spec/nanoc/cli/commands/compile/diff_generator_spec.rb +0 -44
- data/spec/nanoc/cli/commands/compile/file_action_printer_spec.rb +0 -112
- data/spec/nanoc/cli/commands/compile/timing_recorder_spec.rb +0 -287
- data/spec/nanoc/cli/commands/compile_spec.rb +0 -45
- data/spec/nanoc/cli/commands/deploy_spec.rb +0 -329
- data/spec/nanoc/cli/commands/shell_spec.rb +0 -77
- data/spec/nanoc/cli/commands/show_data_spec.rb +0 -286
- data/spec/nanoc/cli/commands/show_plugins_spec.rb +0 -20
- data/spec/nanoc/cli/commands/show_rules_spec.rb +0 -118
- data/spec/nanoc/cli/commands/view_spec.rb +0 -75
- data/spec/nanoc/cli/error_handler_spec.rb +0 -43
- data/spec/nanoc/cli/stack_trace_writer_spec.rb +0 -156
- data/spec/nanoc/cli/stream_cleaners/utf8_spec.rb +0 -9
- data/spec/nanoc/cli_spec.rb +0 -44
- data/spec/nanoc/data_sources/filesystem_spec.rb +0 -128
- data/spec/nanoc/deploying/fog_spec.rb +0 -199
- data/spec/nanoc/deploying/git_spec.rb +0 -305
- data/spec/nanoc/extra/live_recompiler_spec.rb +0 -129
- data/spec/nanoc/extra/parallel_collection_spec.rb +0 -110
- data/spec/nanoc/filters/asciidoctor_spec.rb +0 -12
- data/spec/nanoc/filters/colorize_syntax/rouge_spec.rb +0 -155
- data/spec/nanoc/filters/less_spec.rb +0 -122
- data/spec/nanoc/helpers/blogging_spec.rb +0 -219
- data/spec/nanoc/helpers/breadcrumbs_spec.rb +0 -135
- data/spec/nanoc/helpers/capturing_spec.rb +0 -256
- data/spec/nanoc/helpers/child_parent_spec.rb +0 -76
- data/spec/nanoc/helpers/filtering_spec.rb +0 -77
- data/spec/nanoc/helpers/html_escape_spec.rb +0 -37
- data/spec/nanoc/helpers/link_to_spec.rb +0 -320
- data/spec/nanoc/helpers/rendering_spec.rb +0 -144
- data/spec/nanoc/helpers/tagging_spec.rb +0 -106
- data/spec/nanoc/helpers/text_spec.rb +0 -60
- data/spec/nanoc/integration/compile_command_spec.rb +0 -33
- data/spec/nanoc/integration/outdatedness_integration_spec.rb +0 -269
- data/spec/nanoc/integration/partial_recompilation_spec.rb +0 -50
- data/spec/nanoc/regressions/gh_1015_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_1022_spec.rb +0 -26
- data/spec/nanoc/regressions/gh_1031_spec.rb +0 -56
- data/spec/nanoc/regressions/gh_1035_spec.rb +0 -35
- data/spec/nanoc/regressions/gh_1037a_spec.rb +0 -31
- data/spec/nanoc/regressions/gh_1037b_spec.rb +0 -20
- data/spec/nanoc/regressions/gh_1040_spec.rb +0 -24
- data/spec/nanoc/regressions/gh_1045_spec.rb +0 -50
- data/spec/nanoc/regressions/gh_1047_spec.rb +0 -30
- data/spec/nanoc/regressions/gh_1064_spec.rb +0 -20
- data/spec/nanoc/regressions/gh_1067_spec.rb +0 -36
- data/spec/nanoc/regressions/gh_1082a_spec.rb +0 -20
- data/spec/nanoc/regressions/gh_1082b_spec.rb +0 -22
- data/spec/nanoc/regressions/gh_1082c_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_1082d_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_1093_spec.rb +0 -51
- data/spec/nanoc/regressions/gh_1094_spec.rb +0 -24
- data/spec/nanoc/regressions/gh_1097_spec.rb +0 -23
- data/spec/nanoc/regressions/gh_1100_spec.rb +0 -22
- data/spec/nanoc/regressions/gh_1102_spec.rb +0 -28
- data/spec/nanoc/regressions/gh_1107_spec.rb +0 -15
- data/spec/nanoc/regressions/gh_1130_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_1134_spec.rb +0 -29
- data/spec/nanoc/regressions/gh_1145_spec.rb +0 -18
- data/spec/nanoc/regressions/gh_1171_spec.rb +0 -57
- data/spec/nanoc/regressions/gh_1185_spec.rb +0 -22
- data/spec/nanoc/regressions/gh_1216_spec.rb +0 -91
- data/spec/nanoc/regressions/gh_1248_spec.rb +0 -24
- data/spec/nanoc/regressions/gh_761_spec.rb +0 -25
- data/spec/nanoc/regressions/gh_767_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_769_spec.rb +0 -32
- data/spec/nanoc/regressions/gh_776_spec.rb +0 -42
- data/spec/nanoc/regressions/gh_787_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_795_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_804_spec.rb +0 -28
- data/spec/nanoc/regressions/gh_807_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_809_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_813_spec.rb +0 -24
- data/spec/nanoc/regressions/gh_815_spec.rb +0 -20
- data/spec/nanoc/regressions/gh_828_spec.rb +0 -25
- data/spec/nanoc/regressions/gh_833_spec.rb +0 -16
- data/spec/nanoc/regressions/gh_841_spec.rb +0 -17
- data/spec/nanoc/regressions/gh_867_spec.rb +0 -17
- data/spec/nanoc/regressions/gh_882_spec.rb +0 -31
- data/spec/nanoc/regressions/gh_885_spec.rb +0 -32
- data/spec/nanoc/regressions/gh_891_spec.rb +0 -28
- data/spec/nanoc/regressions/gh_913_spec.rb +0 -26
- data/spec/nanoc/regressions/gh_924_spec.rb +0 -91
- data/spec/nanoc/regressions/gh_928_spec.rb +0 -7
- data/spec/nanoc/regressions/gh_937_spec.rb +0 -27
- data/spec/nanoc/regressions/gh_942_spec.rb +0 -23
- data/spec/nanoc/regressions/gh_947_spec.rb +0 -23
- data/spec/nanoc/regressions/gh_948_spec.rb +0 -18
- data/spec/nanoc/regressions/gh_951_spec.rb +0 -21
- data/spec/nanoc/regressions/gh_954_spec.rb +0 -35
- data/spec/nanoc/regressions/gh_970a_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_970b_spec.rb +0 -52
- data/spec/nanoc/regressions/gh_974_spec.rb +0 -19
- data/spec/nanoc/regressions/gh_981_spec.rb +0 -23
- data/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb +0 -230
- data/spec/nanoc/rule_dsl/recording_executor_spec.rb +0 -145
- data/spec/nanoc/rule_dsl/rule_context_spec.rb +0 -251
- data/spec/nanoc/rule_dsl/rule_spec.rb +0 -111
- data/spec/nanoc/rule_dsl/rules_collection_spec.rb +0 -301
- data/spec/nanoc/spec_spec.rb +0 -70
- data/spec/nanoc/telemetry/counter_spec.rb +0 -20
- data/spec/nanoc/telemetry/labelled_counter_spec.rb +0 -94
- data/spec/nanoc/telemetry/labelled_summary_spec.rb +0 -78
- data/spec/nanoc/telemetry/stopwatch_spec.rb +0 -63
- data/spec/nanoc/telemetry/summary_spec.rb +0 -68
- data/spec/nanoc/telemetry/table_spec.rb +0 -22
- data/spec/nanoc/telemetry_spec.rb +0 -28
- data/spec/regression_filenames_spec.rb +0 -18
- data/spec/spec_helper.rb +0 -371
- data/test/base/test_compiler.rb +0 -389
- data/test/base/test_filter.rb +0 -73
- data/test/base/test_site.rb +0 -146
- data/test/checking/checks/test_css.rb +0 -66
- data/test/checking/checks/test_external_links.rb +0 -88
- data/test/checking/checks/test_html.rb +0 -47
- data/test/checking/checks/test_internal_links.rb +0 -118
- data/test/checking/checks/test_mixed_content.rb +0 -190
- data/test/checking/checks/test_stale.rb +0 -69
- data/test/checking/test_check.rb +0 -22
- data/test/checking/test_dsl.rb +0 -35
- data/test/checking/test_runner.rb +0 -45
- data/test/cli/commands/test_check.rb +0 -20
- data/test/cli/commands/test_compile.rb +0 -199
- data/test/cli/commands/test_create_site.rb +0 -126
- data/test/cli/commands/test_help.rb +0 -10
- data/test/cli/commands/test_prune.rb +0 -157
- data/test/cli/test_cleaning_stream.rb +0 -97
- data/test/cli/test_cli.rb +0 -195
- data/test/cli/test_error_handler.rb +0 -102
- data/test/cli/test_logger.rb +0 -7
- data/test/data_sources/test_filesystem.rb +0 -1033
- data/test/data_sources/test_filesystem_tools.rb +0 -146
- data/test/deploying/test_fog.rb +0 -117
- data/test/deploying/test_git.rb +0 -263
- data/test/deploying/test_rsync.rb +0 -94
- data/test/extra/core_ext/test_time.rb +0 -17
- data/test/extra/test_link_collector.rb +0 -110
- data/test/extra/test_piper.rb +0 -48
- data/test/filters/colorize_syntax/test_coderay.rb +0 -247
- data/test/filters/colorize_syntax/test_common.rb +0 -109
- data/test/filters/colorize_syntax/test_pygmentize.rb +0 -39
- data/test/filters/colorize_syntax/test_pygments.rb +0 -21
- data/test/filters/colorize_syntax/test_simon.rb +0 -24
- data/test/filters/test_asciidoc.rb +0 -16
- data/test/filters/test_bluecloth.rb +0 -16
- data/test/filters/test_coffeescript.rb +0 -16
- data/test/filters/test_erb.rb +0 -107
- data/test/filters/test_erubi.rb +0 -75
- data/test/filters/test_erubis.rb +0 -76
- data/test/filters/test_haml.rb +0 -94
- data/test/filters/test_handlebars.rb +0 -61
- data/test/filters/test_kramdown.rb +0 -56
- data/test/filters/test_markaby.rb +0 -16
- data/test/filters/test_maruku.rb +0 -16
- data/test/filters/test_mustache.rb +0 -43
- data/test/filters/test_pandoc.rb +0 -47
- data/test/filters/test_rainpress.rb +0 -27
- data/test/filters/test_rdiscount.rb +0 -30
- data/test/filters/test_rdoc.rb +0 -14
- data/test/filters/test_redcarpet.rb +0 -111
- data/test/filters/test_redcloth.rb +0 -31
- data/test/filters/test_relativize_paths.rb +0 -887
- data/test/filters/test_rubypants.rb +0 -16
- data/test/filters/test_sass.rb +0 -315
- data/test/filters/test_slim.rb +0 -59
- data/test/filters/test_typogruby.rb +0 -18
- data/test/filters/test_uglify_js.rb +0 -30
- data/test/filters/test_xsl.rb +0 -192
- data/test/filters/test_yui_compressor.rb +0 -42
- data/test/fixtures/vcr_cassettes/css_run_error.yml +0 -70
- data/test/fixtures/vcr_cassettes/css_run_ok.yml +0 -60
- data/test/fixtures/vcr_cassettes/css_run_parse_error.yml +0 -70
- data/test/fixtures/vcr_cassettes/html_run_error.yml +0 -56
- data/test/fixtures/vcr_cassettes/html_run_ok.yml +0 -58
- data/test/helper.rb +0 -255
- data/test/helpers/test_blogging.rb +0 -684
- data/test/helpers/test_capturing.rb +0 -184
- data/test/helpers/test_link_to.rb +0 -57
- data/test/helpers/test_xml_sitemap.rb +0 -246
- data/test/rule_dsl/test_action_provider.rb +0 -80
- data/test/rule_dsl/test_compiler_dsl.rb +0 -448
- data/test/rule_dsl/test_rules_collection.rb +0 -93
@@ -1,778 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe Nanoc::Int::OutdatednessChecker do
|
4
|
-
let(:outdatedness_checker) do
|
5
|
-
described_class.new(
|
6
|
-
site: site,
|
7
|
-
checksum_store: checksum_store,
|
8
|
-
checksums: checksums,
|
9
|
-
dependency_store: dependency_store,
|
10
|
-
action_sequence_store: action_sequence_store,
|
11
|
-
action_sequences: action_sequences,
|
12
|
-
reps: reps,
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:checksum_store) { double(:checksum_store) }
|
17
|
-
|
18
|
-
let(:checksums) do
|
19
|
-
Nanoc::Int::Compiler::Stages::CalculateChecksums.new(
|
20
|
-
items: items,
|
21
|
-
layouts: layouts,
|
22
|
-
code_snippets: code_snippets,
|
23
|
-
config: config,
|
24
|
-
).run
|
25
|
-
end
|
26
|
-
|
27
|
-
let(:dependency_store) do
|
28
|
-
Nanoc::Int::DependencyStore.new(items, layouts, config)
|
29
|
-
end
|
30
|
-
|
31
|
-
let(:items) { Nanoc::Int::ItemCollection.new(config, [item]) }
|
32
|
-
let(:layouts) { Nanoc::Int::LayoutCollection.new(config) }
|
33
|
-
|
34
|
-
let(:code_snippets) { [] }
|
35
|
-
|
36
|
-
let(:site) do
|
37
|
-
Nanoc::Int::Site.new(
|
38
|
-
config: config,
|
39
|
-
code_snippets: code_snippets,
|
40
|
-
data_source: Nanoc::Int::InMemDataSource.new([], []),
|
41
|
-
)
|
42
|
-
end
|
43
|
-
|
44
|
-
let(:action_sequence_store) do
|
45
|
-
Nanoc::Int::ActionSequenceStore.new(site: site)
|
46
|
-
end
|
47
|
-
|
48
|
-
let(:old_action_sequence_for_item_rep) do
|
49
|
-
Nanoc::Int::ActionSequence.build(item_rep) do |b|
|
50
|
-
b.add_filter(:erb, {})
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
let(:new_action_sequence_for_item_rep) { old_action_sequence_for_item_rep }
|
55
|
-
|
56
|
-
let(:action_sequences) do
|
57
|
-
{ item_rep => new_action_sequence_for_item_rep }
|
58
|
-
end
|
59
|
-
|
60
|
-
let(:reps) do
|
61
|
-
Nanoc::Int::ItemRepRepo.new
|
62
|
-
end
|
63
|
-
|
64
|
-
let(:item_rep) { Nanoc::Int::ItemRep.new(item, :default) }
|
65
|
-
let(:item) { Nanoc::Int::Item.new('stuff', {}, '/foo.md') }
|
66
|
-
|
67
|
-
before do
|
68
|
-
reps << item_rep
|
69
|
-
action_sequence_store[item_rep] = old_action_sequence_for_item_rep.serialize
|
70
|
-
end
|
71
|
-
|
72
|
-
describe 'basic outdatedness reasons' do
|
73
|
-
subject { outdatedness_checker.send(:basic).outdatedness_status_for(obj).reasons.first }
|
74
|
-
|
75
|
-
let(:checksum_store) { Nanoc::Int::ChecksumStore.new(objects: items.to_a + layouts.to_a) }
|
76
|
-
|
77
|
-
let(:config) { Nanoc::Int::Configuration.new.with_defaults }
|
78
|
-
|
79
|
-
before do
|
80
|
-
checksum_store.add(item)
|
81
|
-
|
82
|
-
allow(site).to receive(:code_snippets).and_return([])
|
83
|
-
allow(site).to receive(:config).and_return(config)
|
84
|
-
end
|
85
|
-
|
86
|
-
context 'with item' do
|
87
|
-
let(:obj) { item }
|
88
|
-
|
89
|
-
context 'action sequence differs' do
|
90
|
-
let(:new_action_sequence_for_item_rep) do
|
91
|
-
Nanoc::Int::ActionSequence.build(item_rep) do |b|
|
92
|
-
b.add_filter(:super_erb, {})
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
it 'is outdated due to rule differences' do
|
97
|
-
expect(subject).to eql(Nanoc::Int::OutdatednessReasons::RulesModified)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# …
|
102
|
-
end
|
103
|
-
|
104
|
-
context 'with item rep' do
|
105
|
-
let(:obj) { item_rep }
|
106
|
-
|
107
|
-
context 'action sequence differs' do
|
108
|
-
let(:new_action_sequence_for_item_rep) do
|
109
|
-
Nanoc::Int::ActionSequence.build(item_rep) do |b|
|
110
|
-
b.add_filter(:super_erb, {})
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
it 'is outdated due to rule differences' do
|
115
|
-
expect(subject).to eql(Nanoc::Int::OutdatednessReasons::RulesModified)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
# …
|
120
|
-
end
|
121
|
-
|
122
|
-
context 'with layout' do
|
123
|
-
# …
|
124
|
-
end
|
125
|
-
|
126
|
-
context 'with item collection' do
|
127
|
-
let(:obj) { items }
|
128
|
-
|
129
|
-
context 'no new items' do
|
130
|
-
it { is_expected.to be_nil }
|
131
|
-
end
|
132
|
-
|
133
|
-
context 'new items' do
|
134
|
-
before do
|
135
|
-
dependency_store.store
|
136
|
-
|
137
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/newblahz.md')
|
138
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, [item, new_item])
|
139
|
-
|
140
|
-
dependency_store.load
|
141
|
-
end
|
142
|
-
|
143
|
-
it { is_expected.to be_a(Nanoc::Int::OutdatednessReasons::ItemCollectionExtended) }
|
144
|
-
|
145
|
-
it 'includes proper raw_content props' do
|
146
|
-
expect(subject.objects.map(&:identifier).map(&:to_s)).to eq(['/newblahz.md'])
|
147
|
-
end
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
context 'with layout collection' do
|
152
|
-
let(:obj) { layouts }
|
153
|
-
|
154
|
-
context 'no new layouts' do
|
155
|
-
it { is_expected.to be_nil }
|
156
|
-
end
|
157
|
-
|
158
|
-
context 'new layouts' do
|
159
|
-
before do
|
160
|
-
dependency_store.store
|
161
|
-
|
162
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/newblahz.md')
|
163
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
164
|
-
|
165
|
-
dependency_store.load
|
166
|
-
end
|
167
|
-
|
168
|
-
it { is_expected.to be_a(Nanoc::Int::OutdatednessReasons::LayoutCollectionExtended) }
|
169
|
-
|
170
|
-
it 'includes proper raw_content props' do
|
171
|
-
expect(subject.objects.map(&:identifier).map(&:to_s)).to eq(['/newblahz.md'])
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
describe '#outdated_due_to_dependencies?' do
|
178
|
-
subject { outdatedness_checker.send(:outdated_due_to_dependencies?, item) }
|
179
|
-
|
180
|
-
let(:checksum_store) { Nanoc::Int::ChecksumStore.new(objects: items.to_a + layouts.to_a) }
|
181
|
-
|
182
|
-
let(:other_item) { Nanoc::Int::Item.new('other stuff', {}, '/other.md') }
|
183
|
-
let(:other_item_rep) { Nanoc::Int::ItemRep.new(other_item, :default) }
|
184
|
-
|
185
|
-
let(:config) { Nanoc::Int::Configuration.new.with_defaults }
|
186
|
-
|
187
|
-
let(:items) { Nanoc::Int::ItemCollection.new(config, [item, other_item]) }
|
188
|
-
|
189
|
-
let(:old_action_sequence_for_other_item_rep) do
|
190
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
191
|
-
b.add_filter(:erb, {})
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
let(:new_action_sequence_for_other_item_rep) { old_action_sequence_for_other_item_rep }
|
196
|
-
|
197
|
-
let(:action_sequences) do
|
198
|
-
{
|
199
|
-
item_rep => new_action_sequence_for_item_rep,
|
200
|
-
other_item_rep => new_action_sequence_for_other_item_rep,
|
201
|
-
}
|
202
|
-
end
|
203
|
-
|
204
|
-
before do
|
205
|
-
reps << other_item_rep
|
206
|
-
action_sequence_store[other_item_rep] = old_action_sequence_for_other_item_rep.serialize
|
207
|
-
checksum_store.add(item)
|
208
|
-
checksum_store.add(other_item)
|
209
|
-
checksum_store.add(config)
|
210
|
-
|
211
|
-
allow(site).to receive(:code_snippets).and_return([])
|
212
|
-
allow(site).to receive(:config).and_return(config)
|
213
|
-
end
|
214
|
-
|
215
|
-
context 'transitive dependency' do
|
216
|
-
let(:distant_item) { Nanoc::Int::Item.new('distant stuff', {}, '/distant.md') }
|
217
|
-
let(:distant_item_rep) { Nanoc::Int::ItemRep.new(distant_item, :default) }
|
218
|
-
|
219
|
-
let(:items) do
|
220
|
-
Nanoc::Int::ItemCollection.new(config, [item, other_item, distant_item])
|
221
|
-
end
|
222
|
-
|
223
|
-
let(:action_sequences) do
|
224
|
-
{
|
225
|
-
item_rep => new_action_sequence_for_item_rep,
|
226
|
-
other_item_rep => new_action_sequence_for_other_item_rep,
|
227
|
-
distant_item_rep => new_action_sequence_for_other_item_rep,
|
228
|
-
}
|
229
|
-
end
|
230
|
-
|
231
|
-
before do
|
232
|
-
reps << distant_item_rep
|
233
|
-
checksum_store.add(distant_item)
|
234
|
-
action_sequence_store[distant_item_rep] = old_action_sequence_for_other_item_rep.serialize
|
235
|
-
end
|
236
|
-
|
237
|
-
context 'on attribute + attribute' do
|
238
|
-
before do
|
239
|
-
dependency_store.record_dependency(item, other_item, attributes: true)
|
240
|
-
dependency_store.record_dependency(other_item, distant_item, attributes: true)
|
241
|
-
end
|
242
|
-
|
243
|
-
context 'distant attribute changed' do
|
244
|
-
before { distant_item.attributes[:title] = 'omg new title' }
|
245
|
-
|
246
|
-
it 'has correct outdatedness of item' do
|
247
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, item)).not_to be
|
248
|
-
end
|
249
|
-
|
250
|
-
it 'has correct outdatedness of other item' do
|
251
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, other_item)).to be
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
context 'distant raw content changed' do
|
256
|
-
before { distant_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
257
|
-
|
258
|
-
it 'has correct outdatedness of item' do
|
259
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, item)).not_to be
|
260
|
-
end
|
261
|
-
|
262
|
-
it 'has correct outdatedness of other item' do
|
263
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, other_item)).not_to be
|
264
|
-
end
|
265
|
-
end
|
266
|
-
end
|
267
|
-
|
268
|
-
context 'on compiled content + attribute' do
|
269
|
-
before do
|
270
|
-
dependency_store.record_dependency(item, other_item, compiled_content: true)
|
271
|
-
dependency_store.record_dependency(other_item, distant_item, attributes: true)
|
272
|
-
end
|
273
|
-
|
274
|
-
context 'distant attribute changed' do
|
275
|
-
before { distant_item.attributes[:title] = 'omg new title' }
|
276
|
-
|
277
|
-
it 'has correct outdatedness of item' do
|
278
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, item)).to be
|
279
|
-
end
|
280
|
-
|
281
|
-
it 'has correct outdatedness of other item' do
|
282
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, other_item)).to be
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
context 'distant raw content changed' do
|
287
|
-
before { distant_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
288
|
-
|
289
|
-
it 'has correct outdatedness of item' do
|
290
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, item)).not_to be
|
291
|
-
end
|
292
|
-
|
293
|
-
it 'has correct outdatedness of other item' do
|
294
|
-
expect(outdatedness_checker.send(:outdated_due_to_dependencies?, other_item)).not_to be
|
295
|
-
end
|
296
|
-
end
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
context 'only generic attribute dependency' do
|
301
|
-
before do
|
302
|
-
dependency_store.record_dependency(item, other_item, attributes: true)
|
303
|
-
end
|
304
|
-
|
305
|
-
context 'attribute changed' do
|
306
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
307
|
-
it { is_expected.to be }
|
308
|
-
end
|
309
|
-
|
310
|
-
context 'raw content changed' do
|
311
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
312
|
-
it { is_expected.not_to be }
|
313
|
-
end
|
314
|
-
|
315
|
-
context 'attribute + raw content changed' do
|
316
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
317
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
318
|
-
it { is_expected.to be }
|
319
|
-
end
|
320
|
-
|
321
|
-
context 'path changed' do
|
322
|
-
let(:new_action_sequence_for_other_item_rep) do
|
323
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
324
|
-
b.add_filter(:erb, {})
|
325
|
-
b.add_snapshot(:donkey, '/giraffe.txt')
|
326
|
-
end
|
327
|
-
end
|
328
|
-
|
329
|
-
it { is_expected.not_to be }
|
330
|
-
end
|
331
|
-
end
|
332
|
-
|
333
|
-
context 'only specific attribute dependency' do
|
334
|
-
before do
|
335
|
-
dependency_store.record_dependency(item, other_item, attributes: [:title])
|
336
|
-
end
|
337
|
-
|
338
|
-
context 'attribute changed' do
|
339
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
340
|
-
it { is_expected.to be }
|
341
|
-
end
|
342
|
-
|
343
|
-
context 'other attribute changed' do
|
344
|
-
before { other_item.attributes[:subtitle] = 'tagline here' }
|
345
|
-
it { is_expected.not_to be }
|
346
|
-
end
|
347
|
-
|
348
|
-
context 'raw content changed' do
|
349
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
350
|
-
it { is_expected.not_to be }
|
351
|
-
end
|
352
|
-
|
353
|
-
context 'attribute + raw content changed' do
|
354
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
355
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
356
|
-
it { is_expected.to be }
|
357
|
-
end
|
358
|
-
|
359
|
-
context 'other attribute + raw content changed' do
|
360
|
-
before { other_item.attributes[:subtitle] = 'tagline here' }
|
361
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
362
|
-
it { is_expected.not_to be }
|
363
|
-
end
|
364
|
-
|
365
|
-
context 'path changed' do
|
366
|
-
let(:new_action_sequence_for_other_item_rep) do
|
367
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
368
|
-
b.add_filter(:erb, {})
|
369
|
-
b.add_snapshot(:donkey, '/giraffe.txt')
|
370
|
-
end
|
371
|
-
end
|
372
|
-
|
373
|
-
it { is_expected.not_to be }
|
374
|
-
end
|
375
|
-
end
|
376
|
-
|
377
|
-
context 'generic dependency on config' do
|
378
|
-
before do
|
379
|
-
dependency_store.record_dependency(item, config, attributes: true)
|
380
|
-
end
|
381
|
-
|
382
|
-
context 'nothing changed' do
|
383
|
-
it { is_expected.not_to be }
|
384
|
-
end
|
385
|
-
|
386
|
-
context 'attribute changed' do
|
387
|
-
before { config[:title] = 'omg new title' }
|
388
|
-
it { is_expected.to be }
|
389
|
-
end
|
390
|
-
|
391
|
-
context 'other attribute changed' do
|
392
|
-
before { config[:subtitle] = 'tagline here' }
|
393
|
-
it { is_expected.to be }
|
394
|
-
end
|
395
|
-
end
|
396
|
-
|
397
|
-
context 'specific dependency on config' do
|
398
|
-
before do
|
399
|
-
dependency_store.record_dependency(item, config, attributes: [:title])
|
400
|
-
end
|
401
|
-
|
402
|
-
context 'nothing changed' do
|
403
|
-
it { is_expected.not_to be }
|
404
|
-
end
|
405
|
-
|
406
|
-
context 'attribute changed' do
|
407
|
-
before { config[:title] = 'omg new title' }
|
408
|
-
it { is_expected.to be }
|
409
|
-
end
|
410
|
-
|
411
|
-
context 'other attribute changed' do
|
412
|
-
before { config[:subtitle] = 'tagline here' }
|
413
|
-
it { is_expected.not_to be }
|
414
|
-
end
|
415
|
-
end
|
416
|
-
|
417
|
-
context 'only raw content dependency' do
|
418
|
-
before do
|
419
|
-
dependency_store.record_dependency(item, other_item, raw_content: true)
|
420
|
-
end
|
421
|
-
|
422
|
-
context 'attribute changed' do
|
423
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
424
|
-
it { is_expected.not_to be }
|
425
|
-
end
|
426
|
-
|
427
|
-
context 'raw content changed' do
|
428
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
429
|
-
it { is_expected.to be }
|
430
|
-
end
|
431
|
-
|
432
|
-
context 'attribute + raw content changed' do
|
433
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
434
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
435
|
-
it { is_expected.to be }
|
436
|
-
end
|
437
|
-
|
438
|
-
context 'path changed' do
|
439
|
-
let(:new_action_sequence_for_other_item_rep) do
|
440
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
441
|
-
b.add_filter(:erb, {})
|
442
|
-
b.add_snapshot(:donkey, '/giraffe.txt')
|
443
|
-
end
|
444
|
-
end
|
445
|
-
|
446
|
-
it { is_expected.not_to be }
|
447
|
-
end
|
448
|
-
end
|
449
|
-
|
450
|
-
context 'only path dependency' do
|
451
|
-
before do
|
452
|
-
dependency_store.record_dependency(item, other_item, raw_content: true)
|
453
|
-
end
|
454
|
-
|
455
|
-
context 'attribute changed' do
|
456
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
457
|
-
it { is_expected.not_to be }
|
458
|
-
end
|
459
|
-
|
460
|
-
context 'raw content changed' do
|
461
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
462
|
-
it { is_expected.to be }
|
463
|
-
end
|
464
|
-
|
465
|
-
context 'path changed' do
|
466
|
-
let(:new_action_sequence_for_other_item_rep) do
|
467
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
468
|
-
b.add_filter(:erb, {})
|
469
|
-
b.add_snapshot(:donkey, '/giraffe.txt')
|
470
|
-
end
|
471
|
-
end
|
472
|
-
|
473
|
-
it { is_expected.not_to be }
|
474
|
-
end
|
475
|
-
end
|
476
|
-
|
477
|
-
context 'attribute + raw content dependency' do
|
478
|
-
before do
|
479
|
-
dependency_store.record_dependency(item, other_item, attributes: true, raw_content: true)
|
480
|
-
end
|
481
|
-
|
482
|
-
context 'attribute changed' do
|
483
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
484
|
-
it { is_expected.to be }
|
485
|
-
end
|
486
|
-
|
487
|
-
context 'raw content changed' do
|
488
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
489
|
-
it { is_expected.to be }
|
490
|
-
end
|
491
|
-
|
492
|
-
context 'attribute + raw content changed' do
|
493
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
494
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
495
|
-
it { is_expected.to be }
|
496
|
-
end
|
497
|
-
|
498
|
-
context 'rules changed' do
|
499
|
-
let(:new_action_sequence_for_other_item_rep) do
|
500
|
-
Nanoc::Int::ActionSequence.build(other_item_rep) do |b|
|
501
|
-
b.add_filter(:erb, {})
|
502
|
-
b.add_filter(:donkey, {})
|
503
|
-
end
|
504
|
-
end
|
505
|
-
|
506
|
-
it { is_expected.not_to be }
|
507
|
-
end
|
508
|
-
end
|
509
|
-
|
510
|
-
context 'attribute + other dependency' do
|
511
|
-
before do
|
512
|
-
dependency_store.record_dependency(item, other_item, attributes: true, path: true)
|
513
|
-
end
|
514
|
-
|
515
|
-
context 'attribute changed' do
|
516
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
517
|
-
it { is_expected.to be }
|
518
|
-
end
|
519
|
-
|
520
|
-
context 'raw content changed' do
|
521
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
522
|
-
it { is_expected.not_to be }
|
523
|
-
end
|
524
|
-
end
|
525
|
-
|
526
|
-
context 'other dependency' do
|
527
|
-
before do
|
528
|
-
dependency_store.record_dependency(item, other_item, path: true)
|
529
|
-
end
|
530
|
-
|
531
|
-
context 'attribute changed' do
|
532
|
-
before { other_item.attributes[:title] = 'omg new title' }
|
533
|
-
it { is_expected.not_to be }
|
534
|
-
end
|
535
|
-
|
536
|
-
context 'raw content changed' do
|
537
|
-
before { other_item.content = Nanoc::Int::TextualContent.new('omg new content') }
|
538
|
-
it { is_expected.not_to be }
|
539
|
-
end
|
540
|
-
end
|
541
|
-
|
542
|
-
context 'only item collection dependency' do
|
543
|
-
context 'dependency on any new item' do
|
544
|
-
before do
|
545
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
546
|
-
dependency_tracker.enter(item)
|
547
|
-
dependency_tracker.bounce(items, raw_content: true)
|
548
|
-
dependency_store.store
|
549
|
-
end
|
550
|
-
|
551
|
-
context 'nothing changed' do
|
552
|
-
it { is_expected.not_to be }
|
553
|
-
end
|
554
|
-
|
555
|
-
context 'item added' do
|
556
|
-
before do
|
557
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/newblahz.md')
|
558
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, items.to_a + [new_item])
|
559
|
-
dependency_store.load
|
560
|
-
end
|
561
|
-
|
562
|
-
it { is_expected.to be }
|
563
|
-
end
|
564
|
-
|
565
|
-
context 'item removed' do
|
566
|
-
before do
|
567
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, [])
|
568
|
-
dependency_store.load
|
569
|
-
end
|
570
|
-
|
571
|
-
it { is_expected.not_to be }
|
572
|
-
end
|
573
|
-
end
|
574
|
-
|
575
|
-
context 'dependency on specific new items (string)' do
|
576
|
-
before do
|
577
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
578
|
-
dependency_tracker.enter(item)
|
579
|
-
dependency_tracker.bounce(items, raw_content: ['/new*'])
|
580
|
-
dependency_store.store
|
581
|
-
end
|
582
|
-
|
583
|
-
context 'nothing changed' do
|
584
|
-
it { is_expected.not_to be }
|
585
|
-
end
|
586
|
-
|
587
|
-
context 'matching item added' do
|
588
|
-
before do
|
589
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/newblahz.md')
|
590
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, items.to_a + [new_item])
|
591
|
-
dependency_store.load
|
592
|
-
end
|
593
|
-
|
594
|
-
it { is_expected.to be }
|
595
|
-
end
|
596
|
-
|
597
|
-
context 'non-matching item added' do
|
598
|
-
before do
|
599
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/nublahz.md')
|
600
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, items.to_a + [new_item])
|
601
|
-
dependency_store.load
|
602
|
-
end
|
603
|
-
|
604
|
-
it { is_expected.not_to be }
|
605
|
-
end
|
606
|
-
|
607
|
-
context 'item removed' do
|
608
|
-
before do
|
609
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, [])
|
610
|
-
dependency_store.load
|
611
|
-
end
|
612
|
-
|
613
|
-
it { is_expected.not_to be }
|
614
|
-
end
|
615
|
-
end
|
616
|
-
|
617
|
-
context 'dependency on specific new items (regex)' do
|
618
|
-
before do
|
619
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
620
|
-
dependency_tracker.enter(item)
|
621
|
-
dependency_tracker.bounce(items, raw_content: [%r{^/new.*}])
|
622
|
-
dependency_store.store
|
623
|
-
end
|
624
|
-
|
625
|
-
context 'nothing changed' do
|
626
|
-
it { is_expected.not_to be }
|
627
|
-
end
|
628
|
-
|
629
|
-
context 'matching item added' do
|
630
|
-
before do
|
631
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/newblahz.md')
|
632
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, items.to_a + [new_item])
|
633
|
-
dependency_store.load
|
634
|
-
end
|
635
|
-
|
636
|
-
it { is_expected.to be }
|
637
|
-
end
|
638
|
-
|
639
|
-
context 'non-matching item added' do
|
640
|
-
before do
|
641
|
-
new_item = Nanoc::Int::Item.new('stuff', {}, '/nublahz.md')
|
642
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, items.to_a + [new_item])
|
643
|
-
dependency_store.load
|
644
|
-
end
|
645
|
-
|
646
|
-
it { is_expected.not_to be }
|
647
|
-
end
|
648
|
-
|
649
|
-
context 'item removed' do
|
650
|
-
before do
|
651
|
-
dependency_store.items = Nanoc::Int::ItemCollection.new(config, [])
|
652
|
-
dependency_store.load
|
653
|
-
end
|
654
|
-
|
655
|
-
it { is_expected.not_to be }
|
656
|
-
end
|
657
|
-
end
|
658
|
-
end
|
659
|
-
|
660
|
-
context 'only layout collection dependency' do
|
661
|
-
context 'dependency on any new layout' do
|
662
|
-
before do
|
663
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
664
|
-
dependency_tracker.enter(item)
|
665
|
-
dependency_tracker.bounce(layouts, raw_content: true)
|
666
|
-
dependency_store.store
|
667
|
-
end
|
668
|
-
|
669
|
-
context 'nothing changed' do
|
670
|
-
it { is_expected.not_to be }
|
671
|
-
end
|
672
|
-
|
673
|
-
context 'layout added' do
|
674
|
-
before do
|
675
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/newblahz.md')
|
676
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
677
|
-
dependency_store.load
|
678
|
-
end
|
679
|
-
|
680
|
-
it { is_expected.to be }
|
681
|
-
end
|
682
|
-
|
683
|
-
context 'layout removed' do
|
684
|
-
before do
|
685
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, [])
|
686
|
-
dependency_store.load
|
687
|
-
end
|
688
|
-
|
689
|
-
it { is_expected.not_to be }
|
690
|
-
end
|
691
|
-
end
|
692
|
-
|
693
|
-
context 'dependency on specific new layouts (string)' do
|
694
|
-
before do
|
695
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
696
|
-
dependency_tracker.enter(item)
|
697
|
-
dependency_tracker.bounce(layouts, raw_content: ['/new*'])
|
698
|
-
dependency_store.store
|
699
|
-
end
|
700
|
-
|
701
|
-
context 'nothing changed' do
|
702
|
-
it { is_expected.not_to be }
|
703
|
-
end
|
704
|
-
|
705
|
-
context 'matching layout added' do
|
706
|
-
before do
|
707
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/newblahz.md')
|
708
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
709
|
-
dependency_store.load
|
710
|
-
end
|
711
|
-
|
712
|
-
it { is_expected.to be }
|
713
|
-
end
|
714
|
-
|
715
|
-
context 'non-matching layout added' do
|
716
|
-
before do
|
717
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/nublahz.md')
|
718
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
719
|
-
dependency_store.load
|
720
|
-
end
|
721
|
-
|
722
|
-
it { is_expected.not_to be }
|
723
|
-
end
|
724
|
-
|
725
|
-
context 'layout removed' do
|
726
|
-
before do
|
727
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, [])
|
728
|
-
dependency_store.load
|
729
|
-
end
|
730
|
-
|
731
|
-
it { is_expected.not_to be }
|
732
|
-
end
|
733
|
-
end
|
734
|
-
|
735
|
-
context 'dependency on specific new layouts (regex)' do
|
736
|
-
before do
|
737
|
-
dependency_tracker = Nanoc::Int::DependencyTracker.new(dependency_store)
|
738
|
-
dependency_tracker.enter(item)
|
739
|
-
dependency_tracker.bounce(layouts, raw_content: [%r{^/new.*}])
|
740
|
-
dependency_store.store
|
741
|
-
end
|
742
|
-
|
743
|
-
context 'nothing changed' do
|
744
|
-
it { is_expected.not_to be }
|
745
|
-
end
|
746
|
-
|
747
|
-
context 'matching layout added' do
|
748
|
-
before do
|
749
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/newblahz.md')
|
750
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
751
|
-
dependency_store.load
|
752
|
-
end
|
753
|
-
|
754
|
-
it { is_expected.to be }
|
755
|
-
end
|
756
|
-
|
757
|
-
context 'non-matching layout added' do
|
758
|
-
before do
|
759
|
-
new_layout = Nanoc::Int::Layout.new('stuff', {}, '/nublahz.md')
|
760
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, layouts.to_a + [new_layout])
|
761
|
-
dependency_store.load
|
762
|
-
end
|
763
|
-
|
764
|
-
it { is_expected.not_to be }
|
765
|
-
end
|
766
|
-
|
767
|
-
context 'layout removed' do
|
768
|
-
before do
|
769
|
-
dependency_store.layouts = Nanoc::Int::LayoutCollection.new(config, [])
|
770
|
-
dependency_store.load
|
771
|
-
end
|
772
|
-
|
773
|
-
it { is_expected.not_to be }
|
774
|
-
end
|
775
|
-
end
|
776
|
-
end
|
777
|
-
end
|
778
|
-
end
|