<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -252,15 +252,13 @@ describe CouchRest::Database do
   describe &quot;PUT attachment from file&quot; do
     before(:each) do
       filename = FIXTURE_PATH + '/attachments/couchdb.png'
-      @file = File.open(filename)
+      @file = File.open(filename, &quot;rb&quot;)
     end
     after(:each) do
       @file.close
     end
     it &quot;should save the attachment to a new doc&quot; do
-      image = @file.read
-      image.force_encoding('ASCII-8BIT') if image.respond_to?(:force_encoding)
-      r = @db.put_attachment({'_id' =&gt; 'attach-this'}, 'couchdb.png', image, {:content_type =&gt; 'image/png'})
+      r = @db.put_attachment({'_id' =&gt; 'attach-this'}, 'couchdb.png', image = @file.read, {:content_type =&gt; 'image/png'})
       r['ok'].should == true
       doc = @db.get(&quot;attach-this&quot;)
       attachment = @db.fetch_attachment(doc,&quot;couchdb.png&quot;)</diff>
      <filename>spec/couchrest/core/database_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fb3c4530edd69edd1532c558c093aae9bb0f8f58</id>
    </parent>
  </parents>
  <author>
    <name>Peter Gumeson</name>
    <email>gumeson@gmail.com</email>
  </author>
  <url>http://github.com/wildchild/couchrest/commit/027dd9a3ee1eb67499bf7a6643109ae283999e37</url>
  <id>027dd9a3ee1eb67499bf7a6643109ae283999e37</id>
  <committed-date>2009-05-30T15:47:04-07:00</committed-date>
  <authored-date>2009-05-30T15:47:04-07:00</authored-date>
  <message>A better fix for failing spec</message>
  <tree>4bcbcc0181023ca79916979c4a11c2cec75b3a47</tree>
  <committer>
    <name>Peter Gumeson</name>
    <email>gumeson@gmail.com</email>
  </committer>
</commit>
