nanoc 4.8.11 → 4.8.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. data/NEWS.md +10 -0
  3. data/README.md +1 -0
  4. data/lib/nanoc/base/entities/pattern.rb +2 -0
  5. data/lib/nanoc/base/entities/site.rb +1 -1
  6. data/lib/nanoc/base/repos/action_sequence_store.rb +4 -1
  7. data/lib/nanoc/base/repos/compiled_content_cache.rb +2 -2
  8. data/lib/nanoc/base/services/compiler.rb +4 -1
  9. data/lib/nanoc/base/services/compiler/stages/cleanup.rb +3 -3
  10. data/lib/nanoc/filters/colorize_syntax/colorizers.rb +2 -3
  11. data/lib/nanoc/filters/pandoc.rb +1 -1
  12. data/lib/nanoc/version.rb +1 -1
  13. data/nanoc.manifest +4 -6
  14. data/spec/gem_spec.rb +21 -0
  15. data/spec/manifest_spec.rb +2 -2
  16. data/spec/nanoc/base/compiler_spec.rb +7 -2
  17. data/spec/nanoc/base/entities/pattern_spec.rb +6 -0
  18. data/spec/nanoc/base/repos/compiled_content_cache_spec.rb +9 -1
  19. data/spec/nanoc/base/repos/dependency_store_spec.rb +116 -9
  20. data/spec/nanoc/base/repos/store_spec.rb +34 -0
  21. data/spec/nanoc/base/services/compiler/phases/cache_spec.rb +9 -1
  22. data/spec/nanoc/base/services/compiler/stages/cleanup_spec.rb +1 -1
  23. data/spec/nanoc/base/services/compiler/stages/compile_reps_spec.rb +1 -1
  24. data/spec/nanoc/base/services/notification_center_spec.rb +25 -0
  25. data/spec/nanoc/base/services/outdatedness_checker_spec.rb +3 -3
  26. data/spec/nanoc/base/services/outdatedness_rules_spec.rb +2 -2
  27. data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +10 -2
  28. data/spec/nanoc/filters/colorize_syntax/rouge_spec.rb +66 -108
  29. data/spec/nanoc/regressions/gh_1248_spec.rb +24 -0
  30. data/spec/nanoc/rule_dsl/rule_spec.rb +111 -0
  31. data/spec/spec_helper.rb +0 -6
  32. data/test/base/test_compiler.rb +0 -54
  33. data/test/filters/test_pandoc.rb +2 -2
  34. data/test/helper.rb +0 -36
  35. metadata +7 -9
  36. data/Appraisals +0 -13
  37. data/test/base/test_dependency_tracker.rb +0 -265
  38. data/test/base/test_notification_center.rb +0 -32
  39. data/test/base/test_store.rb +0 -39
  40. data/test/rule_dsl/test_rule.rb +0 -27
  41. data/test/test_gem.rb +0 -30
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'helper'
4
-
5
- class Nanoc::Int::NotificationCenterTest < Nanoc::TestCase
6
- def test_post
7
- # Set up notification
8
- Nanoc::Int::NotificationCenter.on :ping_received, :test do
9
- @ping_received = true
10
- end
11
-
12
- # Post
13
- @ping_received = false
14
- Nanoc::Int::NotificationCenter.post :ping_received
15
- assert(@ping_received)
16
- end
17
-
18
- def test_remove
19
- # Set up notification
20
- Nanoc::Int::NotificationCenter.on :ping_received, :test do
21
- @ping_received = true
22
- end
23
-
24
- # Remove observer
25
- Nanoc::Int::NotificationCenter.remove :ping_received, :test
26
-
27
- # Post
28
- @ping_received = false
29
- Nanoc::Int::NotificationCenter.post :ping_received
30
- assert(!@ping_received)
31
- end
32
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'helper'
4
-
5
- class Nanoc::Int::StoreTest < Nanoc::TestCase
6
- class TestStore < Nanoc::Int::Store
7
- def data
8
- @data
9
- end
10
-
11
- def data=(new_data)
12
- @data = new_data
13
- end
14
- end
15
-
16
- def test_delete_and_reload_on_error
17
- store = TestStore.new('test.db', 1)
18
-
19
- # Create
20
- store.load
21
- store.data = { fun: 'sure' }
22
- store.store
23
-
24
- # Test stored values
25
- store = TestStore.new('test.db', 1)
26
- store.load
27
- assert_equal({ fun: 'sure' }, store.data)
28
-
29
- # Mess up
30
- File.open('test.db', 'w') do |io|
31
- io << 'Damn {}#}%@}$^)@&$&*^#@ broken stores!!!'
32
- end
33
-
34
- # Reload
35
- store = TestStore.new('test.db', 1)
36
- store.load
37
- assert_equal(nil, store.data)
38
- end
39
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'helper'
4
-
5
- class Nanoc::Int::RuleTest < Nanoc::TestCase
6
- def test_initialize
7
- # TODO: implement
8
- end
9
-
10
- def test_applicable_to
11
- # TODO: implement
12
- end
13
-
14
- def test_apply_to
15
- # TODO: implement
16
- end
17
-
18
- def test_matches
19
- pattern = Nanoc::Int::Pattern.from(%r{/(.*)/(.*)/})
20
- identifier = '/anything/else/'
21
- expected = %w[anything else]
22
-
23
- rule = Nanoc::RuleDSL::Rule.new(pattern, :string, proc {})
24
-
25
- assert_equal expected, rule.send(:matches, identifier)
26
- end
27
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'helper'
4
-
5
- class Nanoc::GemTest < Nanoc::TestCase
6
- def setup
7
- super
8
- FileUtils.cd(@orig_wd)
9
- end
10
-
11
- def test_build
12
- # Require clean environment
13
- Dir['nanoc-*.gem'].each { |f| FileUtils.rm(f) }
14
-
15
- # Build
16
- files_before = Set.new Dir['**/*']
17
- stdout = StringIO.new
18
- stderr = StringIO.new
19
- piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr)
20
- piper.run(%w[gem build nanoc.gemspec], nil)
21
- files_after = Set.new Dir['**/*']
22
-
23
- # Check new files
24
- diff = files_after - files_before
25
- assert_equal 1, diff.size
26
- assert_match(/^nanoc-.*\.gem$/, diff.to_a[0])
27
- ensure
28
- Dir['nanoc-*.gem'].each { |f| FileUtils.rm(f) }
29
- end
30
- end