spec/configuration_spec.rb in imgkit-1.6.1 vs spec/configuration_spec.rb in imgkit-1.6.2
- old
+ new
@@ -2,10 +2,11 @@
describe IMGKit::Configuration do
describe "#wkhtmltoimage" do
context "system version exists" do
let(:system_path) { "/path/to/wkhtmltoimage\n" }
+ let(:system_path_with_bundler_warning) { "`/` is not writable.\nBundler will use `/tmp/bundler/home/unknown' as your home directory temporarily.\n/path/to/wkhtmltoimage\n" }
before(:each) do
subject.stub :` => system_path
end
@@ -15,9 +16,20 @@
end
it "should return the result of `bundle exec which wkhtmltoimage` with whitespace stripped" do
subject.should_receive(:`).with("bundle exec which wkhtmltoimage")
subject.wkhtmltoimage.should == system_path.chomp
+ end
+
+ context "with warning" do
+ before(:each) do
+ subject.stub :` => system_path_with_bundler_warning
+ end
+
+ it "should return the result of `bundle exec which wkhtmltoimage` with warning stripped" do
+ subject.should_receive(:`).with("bundle exec which wkhtmltoimage")
+ subject.wkhtmltoimage.should == system_path.chomp
+ end
end
end
context "without Bundler" do
before(:each) do