Sha256: f12746230fad96976f0f975aa697cbfb7f04f7bbd70d41b6882dddff70e511d9

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'orm_adapter/example_app_shared'

if !defined?(DataMapper)
  puts "** require 'dm-core' to run the specs in #{__FILE__}"
else

  DataMapper.setup(:default, 'sqlite::memory:')

  module DmOrmSpec
    class User
      include DataMapper::Resource
      property :id,   Serial
      property :name, String
      property :rating, Integer
      has n, :notes, :child_key => [:owner_id]
    end

    class Note
      include DataMapper::Resource
      property :id,   Serial
      property :body, String
      belongs_to :owner, 'User'
    end

    require  'dm-migrations'
    DataMapper.finalize
    DataMapper.auto_migrate!

    # here be the specs!
    describe DataMapper::Resource::OrmAdapter do
      before do
        User.destroy
        Note.destroy
      end

      it_should_behave_like "example app with orm_adapter" do
        let(:user_class) { User }
        let(:note_class) { Note }

        def reload_model(model)
          model.class.get(model.id)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 6 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/orm_adapter-0.5.0/spec/orm_adapter/adapters/data_mapper_spec.rb
orm_adapter-0.5.0 spec/orm_adapter/adapters/data_mapper_spec.rb
orm_adapter-0.4.1 spec/orm_adapter/adapters/data_mapper_spec.rb