spec/merger/css_spec.rb in assets_booster-0.0.10 vs spec/merger/css_spec.rb in assets_booster-0.0.11
- old
+ new
@@ -69,91 +69,9 @@
end
end
lambda{ subject.merge("target.css") }.should raise_error(ArgumentError)
end
end
-
- describe "absolute_url?" do
- it "should detect absolute urls" do
- [
- ["http://www.example.com", true],
- ["HTTP://www.example.com", true],
- ["https://www.example.com", true],
- ["/absolute.css", true],
- ["relative.css", false],
- ["another/relative.css", false],
- ].each do |url, result|
- subject.absolute_url?(url).should == result
- end
- end
- end
-
- describe "path_difference" do
- it "should return the difference" do
- [
- ["", "", ""],
- ["test", "", "test"],
- ["test", "test", ""],
- ["home/test", "", "home/test"],
- ["home/test", "home", "test"],
- ["/home/test", "/home", "test"],
- ].each do |source, target, result|
- subject.path_difference(source, target).should == result
- end
- end
- it "should raise if source and target dont share a common base path" do
- lambda{ subject.path_difference("/home/gucki/test", "/home/peter") }.should raise_error(ArgumentError)
- end
- end
-
- describe "rewrite_urls" do
- it "should rewrite url properties" do
- subject.rewrite_urls("{color:#f00}", "/home/test", "/home/test").should == "{color:#f00}"
- subject.rewrite_urls("{color:#f00; background:url(test.png)}", "nested", "").should == "{color:#f00; background:url(nested/test.png)}"
- source_folder = "/home/test/nested"
- target_folder = "/home/test"
- [
- [
- "{color:#f00}",
- "{color:#f00}",
- ],
- [
- "{color:#f00; background:url(test.png)}",
- "{color:#f00; background:url(nested/test.png)}",
- ],
- [
- "{color:#f00; background:url(\"test.png\")}",
- "{color:#f00; background:url(\"nested/test.png\")}",
- ],
- [
- "{color:#f00; background:url('test.png')}",
- "{color:#f00; background:url('nested/test.png')}",
- ],
- [
- "{color:#f00; background:url('test file.png')}",
- "{color:#f00; background:url('nested/test file.png')}",
- ],
- [
- "{color:#f00; background:url(../test.png)}",
- "{color:#f00; background:url(nested/../test.png)}",
- ],
- ].each do |input, output|
- subject.rewrite_urls(input, source_folder, target_folder).should == output
- end
- end
- end
-
- describe "unquote" do
- it "should return unquoted string and quotes" do
- [
- ["'test.png'", ["test.png", "'"]],
- ['"test.png"', ["test.png", '"']],
- ["test.png", ["test.png", ""]],
- ].each do |input, output|
- subject.unquote(input).should == output
- end
- end
- end
describe "dirname" do
it "should return the folder of the given path" do
[
["test.png", ""],