forked from jekyll/jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_command.rb
39 lines (38 loc) · 1.03 KB
/
test_command.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'helper'
class TestCommand < Test::Unit::TestCase
context "when calling .globs" do
context "when non-default dest & source dirs" do
setup do
@source = source_dir
@dest = dest_dir
directory_with_contents(@dest)
@globs = Command.globs(@source, @dest)
end
should "return an array without the destination dir" do
assert @globs.is_a?(Array)
assert [email protected]?(@dest)
end
teardown do
clear_dest
end
end
context "when using default dest dir" do
setup do
@source = test_dir
@dest = test_dir('_site')
directory_with_contents(@dest)
@globs = Command.globs(@source, @dest)
end
should "return an array without the destination dir" do
assert @globs.is_a?(Array)
assert [email protected]?(@dest)
@globs.each do |glob|
assert !glob.include?(File.basename(@dest))
end
end
teardown do
FileUtils.rm_r(@dest)
end
end
end
end