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)
- - (Object) description
- - (Object) failure_message
-
- (HaveAttachedFileMatcher) initialize(attachment_name)
constructor
A new instance of HaveAttachedFileMatcher.
- - (Boolean) matches?(subject)
- - (Object) negative_failure_message
Constructor Details
- (HaveAttachedFileMatcher) initialize(attachment_name)
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
- (Object) description
34 35 36 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 34 def description "have an attachment named #{@attachment_name}" end |
- (Object) failure_message
26 27 28 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 26 def "Should have an attachment named #{@attachment_name}" end |
- (Boolean) matches?(subject)
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 |
- (Object) negative_failure_message
30 31 32 |
# File 'lib/paperclip/matchers/have_attached_file_matcher.rb', line 30 def "Should not have an attachment named #{@attachment_name}" end |