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
- #description ⇒ Object
- #does_not_contain(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.
12 13 14 15 16 17 18 19 20 |
# File 'lib/generator_spec/matcher.rb', line 12 def initialize(name, &block) @contents = [] @name = name @negative_contents = [] if block_given? instance_eval(&block) end end |
Instance Method Details
#contains(text) ⇒ Object
22 23 24 |
# File 'lib/generator_spec/matcher.rb', line 22 def contains(text) @contents << text end |
#description ⇒ Object
8 9 10 |
# File 'lib/generator_spec/matcher.rb', line 8 def description 'file attributes and content' end |
#does_not_contain(text) ⇒ Object
26 27 28 |
# File 'lib/generator_spec/matcher.rb', line 26 def does_not_contain(text) @negative_contents << text end |