Sha256: 365a77523f33f3af3eceb1aefcf7233d8c2d7b927a18779fb4cb4a901b8858fe

Contents?: true

Size: 875 Bytes

Versions: 2

Compression:

Stored size: 875 Bytes

Contents

module PrivateExtension # :nodoc:
  module PrivateMessages # :nodoc:
    module Shoulda # :nodoc:
      module Matchers # :nodoc:

        def be_private_message
          BePrivateMessage.new
        end

        class BePrivateMessage
          def matches? subject
            @subject = subject
            @subject = @subject.class unless Class === @subject
            included?
          end

          def failure_message
            "Should be private message"
          end

          def negative_failure_message
            "Should not be private message"
          end

          def description
            "is private message"
          end

          protected

          def included?
            @subject.ancestors.include?(PrivateExtension::PrivateMessages::PrivateMessageExtensions::InstanceMethods)
          end
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
user_private_messages-1.0.1 lib/user_private_messages/matchers/be_private_message_matcher.rb
user_private_messages-1.0.0 lib/private_messages/matchers/be_private_message_matcher.rb