Having ruby installed.
Note: I used version 2.3.7.
- Clone the repo by doing by clicking
cloneon the button above or rungit@github.com:rguinea/ol_fractions.gitin your console - Open up your favorite terminal and navigate to the project directory
- There are two files you can run:
main.rbtest.rbBoth are run with the commandruby [filename].
If you run the main.rb file, a program will indefinetly ask you for a fraction operation to be ran. The format in which you need to input the fractions is:
> fraction1 operation fraction2
fraction1 and fraction2 are fractions with the following format
[(whole_part)_](numerator)/(denominator)
All three whole_part, numerator and denominator must be integers.
operation must be one of the following: +,-,*,/
The test file will a set of tests predefined. Fell free to add your own assertions on the test.rb file if you want to test some more edge cases.