spec/imgkit_spec.rb in imgkit-1.0.1 vs spec/imgkit_spec.rb in imgkit-1.0.2
- old
+ new
@@ -140,9 +140,14 @@
imgkit = IMGKit.new('http://google.com')
css = File.join(SPEC_ROOT,'fixtures','example.css')
imgkit.stylesheets << css
lambda { imgkit.to_img }.should raise_error(IMGKit::ImproperSourceError)
end
+
+ it "should throw an error if the wkhtmltoimage command fails" do
+ imgkit = IMGKit.new('http://www.hopefully.this.site.never.exists.asjdhjkalshgflkahfsglkahfdlg11.com')
+ lambda { imgkit.to_img }.should raise_error(IMGKit::CommandFailedError)
+ end
end
context "#to_file" do
before do
@file_path = File.join(SPEC_ROOT,'fixtures','test.jpg')