Module: RSpec::Generator::Helpers
- Defined in:
- lib/rspec_for_generators/matchers/helpers/file.rb
Instance Method Summary collapse
- #check_file(file, type = nil, &block) ⇒ Object (also: #file)
- #check_model(name, clazz, options = {}) ⇒ Object (also: #model)
- #check_view(file_name, matchings) ⇒ Object (also: #view)
Instance Method Details
#check_file(file, type = nil, &block) ⇒ Object Also known as: file
4 5 6 |
# File 'lib/rspec_for_generators/matchers/helpers/file.rb', line 4 def check_file file, type=nil, &block self.should generate_file(file, type, &block) end |
#check_model(name, clazz, options = {}) ⇒ Object Also known as: model
16 17 18 19 20 21 22 23 24 |
# File 'lib/rspec_for_generators/matchers/helpers/file.rb', line 16 def check_model(name, clazz, = {}) self.should generate_file("#{name.underscore}.rb", :model) do |file_content| file_content.should have_class clazz do |content| check_matchings [:matchings] check_methods([:methods]) check_class_methods([:class_methods]) end end end |
#check_view(file_name, matchings) ⇒ Object Also known as: view
9 10 11 12 13 |
# File 'lib/rspec_for_generators/matchers/helpers/file.rb', line 9 def check_view(file_name, matchings) self.should generate_file(filename, :view) do |content| check_matchings matchings end end |