Added list of valid resources if invalid resource is given
Robert Wünsch
committed May 28, 2013
commit 4ba537bd1f39b553de471a62906a8c02056916db
Showing 1
changed file with
1 additions
and 1 deletions
locomotive/wagon.rb b/lib/locomotive/wagon.rb
+1
-1
| @@ | @@ -168,7 +168,7 @@ module Locomotive |
| return if resources.nil? | |
| valid_resources = writers_or_readers.map { |thing| thing.to_s.demodulize.gsub(/Writer$|Reader$/, '').downcase } | |
| resources.each do |resource| | |
| - | raise ArgumentError, "'#{resource}' resource not recognized" unless valid_resources.include?(resource) |
| + | raise ArgumentError, "'#{resource}' resource not recognized. Valid resources are #{valid_resources.join(', ')}." unless valid_resources.include?(resource) |
| end | |
| end | |
| end | |