forked from winton/stasis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstasis_spec.rb
More file actions
50 lines (39 loc) · 1.32 KB
/
stasis_spec.rb
File metadata and controls
50 lines (39 loc) · 1.32 KB
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
40
41
42
43
44
45
46
47
48
49
50
require 'spec_helper'
describe Stasis do
before(:all) do
generate
end
it "should preserve dotfiles" do
$files.keys.include?(".dotfile").should == true
end
it "should copy files that are not markup" do
$files['not_dynamic.html'].should =~ /pass/
end
it "should use the custom plugin" do
$files['custom_plugin.html'].should =~ /pass/
end
describe 'generate with :only option' do
before(:each) do
@index_time = $files['index.html'].split("time")[1].strip
@time_time = $files['time.html'].split("time")[1].strip
end
describe :string do
it "should respect the :only option" do
generate(:only => 'time.html.haml', :reload => true)
new_index_time = $files['index.html'].split("time")[1].strip
new_time_time = $files['time.html'].split("time")[1].strip
new_index_time.should == @index_time
new_time_time.should_not == @time_time
end
end
describe :regex do
it "should respect the :only option" do
generate(:only => /time.html.haml/, :reload => true)
new_index_time = $files['index.html'].split("time")[1].strip
new_time_time = $files['time.html'].split("time")[1].strip
new_index_time.should == @index_time
new_time_time.should_not == @time_time
end
end
end
end