Class: GeneratorSpec::Matcher::File
- Inherits:
-
Object
- Object
- GeneratorSpec::Matcher::File
- Defined in:
- lib/generator_spec/matcher.rb
Overview
Taken (with permission) from beard by Yahuda Katz github.com/carlhuda/beard
Direct Known Subclasses
Instance Method Summary collapse
- #contains(text) ⇒ Object
-
#initialize(name, &block) ⇒ File
constructor
A new instance of File.
- #matches?(root) ⇒ Boolean
Constructor Details
#initialize(name, &block) ⇒ File
Returns a new instance of File.
7 8 9 10 11 12 13 14 |
# File 'lib/generator_spec/matcher.rb', line 7 def initialize(name, &block) @contents = [] @name = name if block_given? instance_eval(&block) end end |
Instance Method Details
#contains(text) ⇒ Object
16 17 18 |
# File 'lib/generator_spec/matcher.rb', line 16 def contains(text) @contents << text end |