Sha256: 1c934c46978cf1c47391080014514ca3a1ebb50f0c0f8e5e0084495290dd406b

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 Bytes

Contents

module Mongoid
  module Matchers
    class BeStoredInMatcher < Matcher
      def initialize collection_name
        @collection_name = collection_name.to_s
      end

      def matches? subject
        class_of(subject).collection_name.to_s == @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

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-minitest-1.0.0 lib/matchers/document/be_stored_in.rb