Class: FileSandbox::HaveContents
- Inherits:
-
Object
- Object
- FileSandbox::HaveContents
- Defined in:
- spec_help/file-sandbox.rb
Instance Method Summary (collapse)
-
- (HaveContents) initialize(contents)
constructor
A new instance of HaveContents.
- - (Boolean) matches?(target)
Constructor Details
- (HaveContents) initialize(contents)
A new instance of HaveContents
18 19 20 |
# File 'spec_help/file-sandbox.rb', line 18 def initialize(contents) @contents = contents end |
Instance Method Details
- (Boolean) matches?(target)
22 23 24 25 26 27 28 29 |
# File 'spec_help/file-sandbox.rb', line 22 def matches?(target) case @contents when Regexp @contents =~ target.contents when String @contents == target.contents end end |