Module: TestHelper
- Defined in:
- vendor/plugins/engines/test/lib/engines_test_helper.rb
Class Method Summary
Class Method Details
+ (Object) report_location(path)
2 3 4 5 6 7 8 9 10 11 12 |
# File 'vendor/plugins/engines/test/lib/engines_test_helper.rb', line 2 def self.report_location(path) [RAILS_ROOT + '/', 'vendor/plugins/'].each { |part| path.sub! part, ''} path = path.split('/') location, subject = path.first, path.last if subject.sub! '.rb', '' subject = subject.classify else subject.sub! '.html.erb', '' end "#{subject} (from #{location})" end |
+ (Object) view_path_for(path)
14 15 16 17 18 |
# File 'vendor/plugins/engines/test/lib/engines_test_helper.rb', line 14 def self.view_path_for path [RAILS_ROOT + '/', 'vendor/plugins/', '.html.erb'].each { |part| path.sub! part, ''} parts = path.split('/') parts[(parts.index('views')+1)..-1].join('/') end |