Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/williamrolando88/ruby-exercise


https://github.com/williamrolando88/ruby-exercise

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

# TDD Exercise

> A project exercise where we implement the methodology of Test-Driven-Development(TDD)
in order to create a class called `Solver` that contains three methods:
- factorial
- reverse
- fizzbuzz

Factorial that takes one argument, an integer N, and returns the factorial for that number.
The factorial is the multiplication of all integers from 1 to N and has the special case that
the factorial of 0 is 1. This method only accepts 0 and positive integers, so if a negative integer
is given it should raise an exception.

Reverse that takes one argument, a string word, and returns word reversed (e.g. if word is "hello"
it returns "olleh").

Fizzbuzz that takes one argument, an integer N, and returns a string. The returned string is constructed
following these rules:

- When N is divisible by 3, return "fizz".
- When N is divisible by 5, return "buzz".
- When N is divisible by 3 and 5, return "fizzbuzz".
- Any other case, return N as a string (e.g. say N is 7 then return "7").

## 🧩 Built With

- Ruby.
- Linters. (Rubocop)
- RSpec.
## πŸ–₯️ Install

- Install Ruby based on your OS from [HERE](https://www.ruby-lang.org/en/downloads/).

## πŸ“š Getting Started

1. Clone the project using git-bash or Github Desktop.
2. Open the project folder with VSCode or any Editor.
3. Open terminal and navigate to the project folder.
4. Type `irb`.
5. Copy the code from files and run it.
6. Run `rspec spec` in the terminal and see them pass all tests.

## Authors

πŸ‘€ **William Morales**

- GitHub: [@williamrolando88](https://github.com/williamrolando88)
- Twitter: [@WillyMorales93](https://twitter.com/WillyMorales93)
- LinkedIn: [William Morales](https://www.linkedin.com/in/william-rolando-morales/)

πŸ‘€ **Luis Abarca**

- GitHub: [@TheLuisAbarca](https://github.com/theLuisAbarca/)
- Twitter: [@TheLuisAbarca](https://twitter.com/TheLuisAbarca)
- LinkedIn: [LuΓ­s Anghelo Abarca VillacΓ­s](https://www.linkedin.com/in/techadvisor-luis-abarca/)

## 🀝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the [issues page](../../issues).

## πŸ‘ Show your support

Give a ⭐️ if you like this project!

## πŸ“ License

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Copyright (c) 2022 William Morales, Luis Abarca

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.