anchor.diff:  -include_lib("couch/include/couch_db.hrl").
   
   
  --ifdef(run_broken_tests).
  -
  -setup() ->
  -    {ok, Pid} = test_util:start_config(?CONFIG_CHAIN),
  -    config:set("attachments", "compression_level", "0", false),
  -    Pid.
  -
  -teardown(_) ->
  -    test_util:stop_config().
  -
  -
   json_doc_test_() ->
       {
           setup,
  -        fun setup/0, fun teardown/1,
  +        fun() -> test_util:start(?MODULE) end, fun test_util:stop/1,
           [
               {
                   "Document from JSON",
  
positive.code:         {
              [attachments],
              #doc{atts = [
                  #att{
                      name = <<"stuff.txt">>,
                      type = <<"text/plain">>,
                      data = fun() -> <<"diet pepsi">> end,
                      revpos = 1,
                      att_len = 10,
                      disk_len = 10
                  },
                  #att{
                      name = <<"food.now">>,
                      type = <<"application/food">>,
                      revpos = 1,
                      data = <<"sammich">>
                  }
              ]},
              {[
                  {<<"_id">>, <<>>},
  
negative.code:                 ]}}
              ]}}]},
              #doc{atts = [
                  couch_att:new([
                      {name, <<"my_attachment.fu">>},
                      {data, stub},
                      {type, <<"application/awesome">>},
                      {att_len, 45},
                      {disk_len, 45},
                      {revpos, undefined}
                  ]),
                  couch_att:new([
                      {name, <<"noahs_private_key.gpg">>},
                      {data, <<"I have a pet fish!">>},
                      {type, <<"application/pgp-signature">>},
                      {att_len, 18},
                      {disk_len, 18},
                      {revpos, 0}
                  ])
              ]},
              "Attachments are parsed correctly."
          },
  