nanoc 4.8.11 → 4.8.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/NEWS.md +10 -0
- data/README.md +1 -0
- data/lib/nanoc/base/entities/pattern.rb +2 -0
- data/lib/nanoc/base/entities/site.rb +1 -1
- data/lib/nanoc/base/repos/action_sequence_store.rb +4 -1
- data/lib/nanoc/base/repos/compiled_content_cache.rb +2 -2
- data/lib/nanoc/base/services/compiler.rb +4 -1
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +3 -3
- data/lib/nanoc/filters/colorize_syntax/colorizers.rb +2 -3
- data/lib/nanoc/filters/pandoc.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.manifest +4 -6
- data/spec/gem_spec.rb +21 -0
- data/spec/manifest_spec.rb +2 -2
- data/spec/nanoc/base/compiler_spec.rb +7 -2
- data/spec/nanoc/base/entities/pattern_spec.rb +6 -0
- data/spec/nanoc/base/repos/compiled_content_cache_spec.rb +9 -1
- data/spec/nanoc/base/repos/dependency_store_spec.rb +116 -9
- data/spec/nanoc/base/repos/store_spec.rb +34 -0
- data/spec/nanoc/base/services/compiler/phases/cache_spec.rb +9 -1
- data/spec/nanoc/base/services/compiler/stages/cleanup_spec.rb +1 -1
- data/spec/nanoc/base/services/compiler/stages/compile_reps_spec.rb +1 -1
- data/spec/nanoc/base/services/notification_center_spec.rb +25 -0
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +3 -3
- data/spec/nanoc/base/services/outdatedness_rules_spec.rb +2 -2
- data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +10 -2
- data/spec/nanoc/filters/colorize_syntax/rouge_spec.rb +66 -108
- data/spec/nanoc/regressions/gh_1248_spec.rb +24 -0
- data/spec/nanoc/rule_dsl/rule_spec.rb +111 -0
- data/spec/spec_helper.rb +0 -6
- data/test/base/test_compiler.rb +0 -54
- data/test/filters/test_pandoc.rb +2 -2
- data/test/helper.rb +0 -36
- metadata +7 -9
- data/Appraisals +0 -13
- data/test/base/test_dependency_tracker.rb +0 -265
- data/test/base/test_notification_center.rb +0 -32
- data/test/base/test_store.rb +0 -39
- data/test/rule_dsl/test_rule.rb +0 -27
- 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
|
data/test/base/test_store.rb
DELETED
@@ -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
|
data/test/rule_dsl/test_rule.rb
DELETED
@@ -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
|
data/test/test_gem.rb
DELETED
@@ -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
|