Sha256: 4cf5c1835fdca956e586e68ade2065f1963498660d39845c9cb76fa665465108

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

class Address; end

describe "MarkMapper" do
  it "should be able to write and read connection" do
    conn = MarkLogic::Connection.new(HOST, PORT)
    MarkMapper.connection = conn
    MarkMapper.connection.should == conn
  end

  it "should default connection to new marklogic ruby driver" do
    MarkMapper.connection = nil
    MarkMapper.connection.should be_instance_of(MarkLogic::Connection)
  end

  it "should be able to write and read default database" do
    MarkMapper.database = 'test'
    MarkMapper.database.should be_instance_of(MarkLogic::Database)
    MarkMapper.database.database_name.should == 'test'
  end

  it "should have document not found error" do
    lambda {
      MarkMapper::DocumentNotFound
    }.should_not raise_error
  end

  it "should be able to read/write config" do
    config = {
      'development' => {'host' => '127.0.0.1', 'port' => 8006, 'database' => 'test'},
      'production'  => {'host' => '127.0.0.1', 'port' => 8006, 'database' => 'test-prod'}
    }
    MarkMapper.config = config
    MarkMapper.config.should == config
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mark_mapper-0.0.6 spec/unit/mark_mapper_spec.rb
mark_mapper-0.0.5 spec/unit/mark_mapper_spec.rb
mark_mapper-0.0.4 spec/unit/mark_mapper_spec.rb
mark_mapper-0.0.3 spec/unit/mark_mapper_spec.rb
mark_mapper-0.0.2 spec/unit/mark_mapper_spec.rb
mark_mapper-0.0.1 spec/unit/mark_mapper_spec.rb