Sha256: 69ddfa5b9676194717794de4f100fb8e0a42d63410c62c71c94e5fd5620b2657

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

module Mongoid
  module Matchers
    class BeStoredInMatcher
      include Helpers

      def initialize(collection_name)
        @collection_name = collection_name.to_s
      end

      def matches?(subject)
        class_of(subject).collection_name == @collection_name
      end

      def description
        "be stored in #{@collection_name.inspect}"
      end
    end

    def be_stored_in(collection_name)
      BeStoredInMatcher.new(collection_name)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-minitest-0.0.3.1 lib/matchers/document/be_stored_in.rb
mongoid-minitest-0.0.3 lib/matchers/document/be_stored_in.rb
mongoid-minitest-0.0.2 lib/matchers/document/be_stored_in.rb