describe :script do
it "raises Invalid_Relative_HREF if :src is not relative" do
should.raise(Escape_Escape_Escape::Invalid_Relative_HREF) {
actual do
script.src('http://www.example.org/file.js')./
end
}.message.should.match /example\.org/
end
it "allows a relative :src" do
target %^^
actual {
script.src('/file.js')./
}
end
it "escapes slashes in attr :src" do
target %^^
actual {
script.src('/dir/file.js')./
}
end
it "does not allow vars in :script :src attribute" do
target :body, <<-EOF
EOF
actual do
script.src(:help)
end
end
it "ignores text for :script block" do
target %^^
actual {
script.src('/hello.js') { 'hello' }
}
end
end # === describe :JS ===