Sha256: 82ce122f935825ad28abeacca7457afa35aeab08d7c44f51beb174daee8a9230

Contents?: true

Size: 839 Bytes

Versions: 7

Compression:

Stored size: 839 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "dm-datastore-adapter" do
  class ::Person
    include DataMapper::Resource
    def self.default_repository_name; :datastore end
    property :id, Serial
    property :name, String
    property :age, Integer
    property :weight, Float
    property :created_at, DateTime
    property :created_on, Date
    belongs_to :company
  end

  class ::Company
    include DataMapper::Resource
    def self.default_repository_name; :datastore end
    property :id, Serial
    property :name, String
    has n, :users
  end

  before do
    @person = Person.new(:name => 'Jon', :age => 40, :weight => 100)
  end

  it "should build person" do
    @person.should_not be_nil
  end

  it "should save person successfully" do
    pending "Needing mocks"
    @person.save.should be_true
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
genki-dm-datastore-adapter-0.2.2 spec/dm-datastore-adapter_spec.rb
genki-dm-datastore-adapter-0.2.4 spec/dm-datastore-adapter_spec.rb
dm-datastore-adapter-0.2.1 spec/dm-datastore-adapter_spec.rb
dm-datastore-adapter-0.1.0 spec/dm-datastore-adapter_spec.rb
dm-datastore-adapter-0.2.4 spec/dm-datastore-adapter_spec.rb
dm-datastore-adapter-0.2.2 spec/dm-datastore-adapter_spec.rb
dm-datastore-adapter-0.2.3 spec/dm-datastore-adapter_spec.rb