Sha256: c5332f6ea5be6fc410cc398c12c1a6de19bd1b0a2af441498a0a4b81049da0a0

Contents?: true

Size: 287 Bytes

Versions: 13

Compression:

Stored size: 287 Bytes

Contents

module Mongomatic
  module Expectations
    class BeReference < Expectation
      def self.name
        "reference"
      end
  
      def to_be
        return true if opts[:allow_nil] && value.nil?
    
        add_error_msg unless value.is_a? BSON::ObjectId
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mongomatic-0.9.0.pre lib/mongomatic/expectations/be_reference.rb
mongomatic-0.8.2 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.8.1.1 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.7.3 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.7.2 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.7.1 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.7.0 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.5 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.4 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.3 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.2 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.1 lib/mongomatic/expectations/be_reference.rb
mongomatic-0.6.0 lib/mongomatic/expectations/be_reference.rb