Sha256: bf983cae6f5ccf97a25374dccb9690b9ae3cb13c33902eebdb686c2509836296

Contents?: true

Size: 775 Bytes

Versions: 11

Compression:

Stored size: 775 Bytes

Contents

$LOAD_PATH << File.dirname(__FILE__)

require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'

#
# I need to make the Book class for Books to relate to
#
class Book
  include DataMapper::Resource
 
  # Persevere only does id's as strings.  
  property :id, String, :serial => true
  property :author, String
  property :created_at, DateTime
  property :title, String
end

describe 'A Persevere adapter' do

  before do
    @adapter = DataMapper::Repository.adapters[:default]
  end
  
  describe 'when saving a resource' do

    before do
      @book = Book.new(:title => 'Hello, World!', :author => 'Anonymous')
    end

    it 'should call the adapter create method' do
      #@adapter.should_receive(:create).with([@book])
      @book.save
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dm-persevere-adapter-0.31.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.30.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.29.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.28.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.27.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.26.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.25.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.23.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.22.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.21.0 spec/unit/create_spec.rb
dm-persevere-adapter-0.18.0 spec/unit/create_spec.rb