Sha256: 27433dc9833f30ccb204893716a473ad48d6640a6c2d8fdf40e15b810583f313

Contents?: true

Size: 695 Bytes

Versions: 5

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'


describe DataMapper::Matchers::HaveProperty do
  context '#should' do
    it 'passes if property exists' do
      lambda {Book.should have_property :name}.should_pass
    end

    it 'fails if property does not exist' do
      lambda {Book.should have_property :bad_property}.should fail_with "expected to have property bad_property"
    end
  end

  context '#should_not' do
    it 'fails if property exists' do
      lambda {Book.should_not have_property :name}.should fail_with "expected to not have property name"
    end
  end

  context 'instance of model' do
    it "should pass" do
      lambda{ Book.new.should have_property :name}.should_pass
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dm-rspec-0.2.4 spec/dm/matchers/have_property_spec.rb
dm-rspec-0.2.3 spec/dm/matchers/have_property_spec.rb
dm-rspec-0.2.2 spec/dm/matchers/have_property_spec.rb
dm-rspec-0.2.1 spec/dm/matchers/have_property_spec.rb
dm-rspec-0.2.0 spec/dm/matchers/have_property_spec.rb