Sha256: 752eb960ffc3057d6b27c3b84ced3364d90eb97f9ee74a72879c980ac39efe1f

Contents?: true

Size: 773 Bytes

Versions: 9

Compression:

Stored size: 773 Bytes

Contents

#
# testing rufus-jig
#
# Tue Dec 29 14:45:22 JST 2009
#

require File.join(File.dirname(__FILE__), 'couch_base')


class CtCouchDbOptionsTest < Test::Unit::TestCase

  def setup

    h = Rufus::Jig::Http.new('127.0.0.1', 5984)

    begin
      h.delete('/rufus_jig_test')
    rescue Exception => e
      #p e
    end

    h.put('/rufus_jig_test', '')
    h.put('/rufus_jig_test/coffee1', '{"_id":"coffee1","type":"ristretto"}')

    h.close

    @c = Rufus::Jig::Couch.new(
      '127.0.0.1', 5984, 'rufus_jig_test', :re_put_ok => false)
  end

  def teardown

    @c.close
  end

  def test_put_gone

    doc = @c.get('coffee1')
    @c.delete(doc)

    assert_nil @c.get('coffee1')

    doc['whatever'] = 'else'

    r = @c.put(doc)

    assert_equal true, r
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rufus-jig-0.1.17 test/ct_2_couchdb_options.rb
rufus-jig-0.1.16 test/ct_2_couchdb_options.rb
rufus-jig-0.1.15 test/ct_2_couchdb_options.rb
rufus-jig-0.1.14 test/ct_2_couchdb_options.rb
rufus-jig-0.1.13 test/ct_2_couchdb_options.rb
rufus-jig-0.1.12 test/ct_2_couchdb_options.rb
rufus-jig-0.1.11 test/ct_2_couchdb_options.rb
rufus-jig-0.1.10 test/ct_2_couchdb_options.rb
rufus-jig-0.1.9 test/ct_2_couchdb_options.rb