Sha256: d039c76e424ade9dffe2baeec3fee95b709e3beba413a83bf92bf56d241919ee
Contents?: true
Size: 559 Bytes
Versions: 33
Compression:
Stored size: 559 Bytes
Contents
describe Patch do context 'Models' do it 'defines all models' do constants.each do |constant| expect { Patch.const_get(constant) }.not_to raise_error end end end def constants # Given a file path return the constant of that path, for example: # 'lib/patch_ruby/models/project_response.rb' -> ProjectResponse Dir.glob("lib/patch_ruby/models/*.rb").map do |file| parsed_filename = file.split('/').last.split('.').first constant = parsed_filename.split('_').map(&:capitalize).join('') end end end
Version data entries
33 entries across 33 versions & 1 rubygems