In this test we convert numbers to words to a superman name.
Install ruby using RVM
-
Store all mappings and reverse mappings in yml file
-
Store dictionary as hash index in index_dict.yml file
-
Retrieve data from stored yml files for conversion
cd superhero
- Make mapping and reverse mapping yml file
ruby mapping.rb
- Make a index dictionary yml file
ruby index_dict.rb
-
Convert numbers to words
a. Default with given inputs
ruby conversion.rb
b. With external arguments
ruby conversion.rb " 0 8467 " "0 228626"
-
Test cases are written in Minitest
ruby -Ilib conversion_test.rb
In this test we find the cheapest hotel from the dates and type given
Install node using NVM
-
Store all default, inputs and outputs in js file
-
Retrieve data from stored js files for finding cheapest hotel
cd hotel_room_reservation
- Install Node packages
npm install
-
Finding cheapest hotel
a. With Default inputs
node cheapest.js
b. With external arguments
node cheapest.js "Regular: 16Mar2009(mon), 17Mar2009(tues), 18Mar2009(wed)" "Regular: 20Mar2009(fri), 21Mar2009(sat), 22Mar2009(sun) " " Rewards: 26Mar2009(thur), 27Mar2009(fri), 28Mar2009(sat) "
-
Test cases are written in Mocha & Chai
npm test