Permalink
Browse files

Update AssetFile specs

  • Loading branch information...
1 parent d23316e commit f2864fc31d49f1301c7fe8f2dd15a724160b302f @ixti ixti committed Feb 16, 2013
Showing with 25 additions and 3 deletions.
  1. +25 −3 spec/lib/jekyll/assets_plugin/asset_file_spec.rb
View
28 spec/lib/jekyll/assets_plugin/asset_file_spec.rb
@@ -4,9 +4,31 @@
module Jekyll::AssetsPlugin
describe AssetFile do
context "#destination" do
- let(:file) { AssetFile.new(@site, @site.assets["app.css"]) }
- subject { file.destination @dest.to_s }
- it { should match %r{/app-[0-9a-f]{32}\.css$} }
+ subject do
+ AssetFile.new(@site, @site.assets["app.css"]).destination @dest.to_s
+ end
+
+ context "with none cachebust" do
+ before { @site.assets_config.cachebust = :none }
+ it { should match(%r{/app\.css$}) }
+ end
+
+ context "with soft cachebust" do
+ before { @site.assets_config.cachebust = :soft }
+ it { should match(%r{/app\.css$}) }
+ end
+
+ context "with hard cachebust" do
+ before { @site.assets_config.cachebust = :hard }
+ it { should match %r{/app-[0-9a-f]{32}\.css$} }
+ end
+
+ context "with unknown cachebust" do
+ before { @site.assets_config.cachebust = :wtf }
+ it "should raise error" do
+ expect { @site.asset_path "app.css" }.to raise_error
+ end
+ end
end
end
end

0 comments on commit f2864fc

Please sign in to comment.