Class: Paperclip::Shoulda::Matchers::HaveAttachedFileMatcher
- Inherits:
-
Object
- Object
- Paperclip::Shoulda::Matchers::HaveAttachedFileMatcher
- Defined in:
- lib/paperclip/matchers/have_attached_file_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(attachment_name) ⇒ HaveAttachedFileMatcher
constructor
A new instance of HaveAttachedFileMatcher.
- #matches?(subject) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(attachment_name) ⇒ HaveAttachedFileMatcher
Returns a new instance of HaveAttachedFileMatcher.
16 17 18 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 16 def initialize @attachment_name = end |
Instance Method Details
#description ⇒ Object
34 35 36 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 34 def description "have an attachment named #{@attachment_name}" end |
#failure_message ⇒ Object
26 27 28 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 26 def "Should have an attachment named #{@attachment_name}" end |
#matches?(subject) ⇒ Boolean
20 21 22 23 24 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 20 def matches? subject @subject = subject @subject = @subject.class unless Class === @subject responds? && has_column? && included? end |
#negative_failure_message ⇒ Object
30 31 32 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 30 def "Should not have an attachment named #{@attachment_name}" end |