class Mongoid::Matchers::BeStoredInMatcher

Attributes

collection_name[R]

Public Class Methods

new(collection_name) click to toggle source
# File lib/matchers/document/be_stored_in.rb, line 12
def initialize collection_name
  @collection_name = collection_name.to_s
end

Public Instance Methods

description() click to toggle source
# File lib/matchers/document/be_stored_in.rb, line 28
def description
  "be stored in #{collection_name.inspect}"
end
failure_message() click to toggle source
# File lib/matchers/document/be_stored_in.rb, line 20
def failure_message
  "Expected #{inspect} to #{description}"
end
matches?(subject) click to toggle source
# File lib/matchers/document/be_stored_in.rb, line 16
def matches? subject
  class_of(subject).collection_name.to_s == collection_name
end
negative_failure_message() click to toggle source
# File lib/matchers/document/be_stored_in.rb, line 24
def negative_failure_message
  "Expected not to #{description}"
end